Query - SQL error? (postgressql)

Query - SQL error? (postgressql)

Hi

I'm working on a query, but have hit a wall when only halfway there.

Can anyone tell me please why this works:

SELECT aau.FIRST_NAME AS "Requester", COUNT(*) as "Total"
FROM WorkOrder wo LEFT JOIN SDUser sdu ON wo.REQUESTERID=sdu.USERID LEFT JOIN AaaUser aau ON sdu.USERID=aau.USER_ID
WHERE (wo.ISPARENT='1') 
GROUP BY "Requester"

But this:

SELECT aau.FIRST_NAME AS "Requester", COUNT(*) as "Total"
FROM WorkOrder wo LEFT JOIN SDUser sdu ON wo.REQUESTERID=sdu.USERID LEFT JOIN AaaUser aau ON sdu.USERID=aau.USER_ID
WHERE (wo.ISPARENT='1') 
GROUP BY "Requester"
ORDER BY "Total"

Gives this error:

net.sf.jasperreports.engine.design.JRValidationException: Report design not valid :
  1. Field not found : null
  2. Field not found : null
 at net.sf.jasperreports.engine.design.JRAbstractCompiler.verifyDesign(JRAbstractCompiler.java:271)
 at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:153)

...

...



As far as I can find out it should be OK to do that.

Many thanks.

                  New to ADSelfService Plus?