After playing with mysql still not understand what going on you can see at image attached how give me different results...
first on is runing client mysqlfront.....
second is runing design mode connect and run sql
thirth one is running application don't send me error but not result...
sql statement
Select A.DEPT_NO, A.DEPARTMENT, A.HEAD_DEPT, A.MNGR_NO, A.BUDGET, A.LOCATION, A.PHONE_NO, count(B.DEPT_NO) as ChildCount,
case when A.Budget > 5000 then 0 when A.Budget < 5000 then 2 else 1 end as ImageIndex
From DEPARTAMENT A Left Outer JOIN DEPARTAMENT AS B On B.HEAD_DEPT = A.DEPT_NO
where A.HEAD_DEPT is null AND A.DEPT_NO <> ' '
Group By A.DEPT_NO
Order by Department