Rodolfo J. Paiz wrote:
> On Thu, 2005-01-27 at 12:31 +1100, Alexander Borkowski wrote:
>
>>Sorry, I totally missed the crucial point there. How about
>>
>>select date_trunc('month', date) as sort_month, to_char(date,'Mon YYYY')
>>as month, count(num) as num, sum(hrs_total) as hours from flights group
>>by sort_month, month order by sort_month asc;
[...]
> This would be perfect if we could get rid of that first column and only
> display the rest. Is that possible?
Apart from just not displaying it on the client side you can do a
subselect. For example:
select to_char(monthly_flights.sort_month, 'Mon YYYY') as month,
monthly_flights.num, monthly_flights.hours
from (
select date_trunc('month', date) as sort_month, count(num) as num,
sum(hrs_total) as hours
from flights group by sort_month
) as monthly_flights
order by monthly_flights.sort_month asc;
Cheers,
Alex