Subject Re: [firebird-support] What's wrong with this SQL?
Author Mercea Paul
On 2011.09.20 8:53 AM, Kjell Rilbe wrote:
>
> Consider this SQL:
>
> select
> case when "RemovedAt" is null then 'Cur' else 'Hist' end "Category",
> count(*) "Count"
> from "Objects"
> where "ObjectKind" = 92
> group by case when "RemovedAt" is null then 'Cur' else 'Hist' end
> order by case when "RemovedAt" is null then 'Cur' else 'Hist' end
>
> Why would that SQL give me this error:
>
> SQL Message : -104
> Invalid token
> 0733-44 24 64
>

Could you try:
select
case when "RemovedAt" is null then 'Cur' else 'Hist' end "Category",
count(*) "Count"
from "Objects"
where "ObjectKind" = 92
group by 1
order by 1

Regards,
Paul


[Non-text portions of this message have been removed]