UPDATING QUESTION:
ERROR: column \"Fruits\" does not exist
Running Postgres 7.4(Yeah we are upgrading)
Why can\'t I ORDER BY the
You can use ORDER BY 1 to order by the first field, which is "Fruits". The same is valid for GROUP BY
Update
For the order, instead of doing the case in the order by, create a new column in.. say.. the second position:
(CASE
WHEN "Fruits" = 'Apple' THEN 1
WHEN "Fruits" = 'Pear' THEN 2
WHEN "Fruits" = 'Grapes' THEN 3
ELSE 4 ) as Order
Then in you ORDER BY 2.