Re: [firebird-support] What's wrong with this SQL?

2011-09-20 Thread Kjell Rilbe
Den 2011-09-20 10:48 skrev Svein Erling Tysvær såhär: > > I was under the impression that the query parser would recognize that > > the two expressions are identical. That's actually how it works in SQL > > Server 2008. In fact, there you HAVE to use that syntax; you CANNOT > > refer to the sel

Re: [firebird-support] What's wrong with this SQL?

2011-09-20 Thread Norman Dunbar
Morning all, On 20/09/11 09:25, Kjell Rilbe wrote: > ... > I was under the impression that the query parser would recognize that > the two expressions are identical. That's actually how it works in SQL > Server 2008. In fact, there you HAVE to use that syntax; you CANNOT > refer to the select l

RE: [firebird-support] What's wrong with this SQL?

2011-09-20 Thread Svein Erling Tysvær
> I was under the impression that the query parser would recognize that > the two expressions are identical. That's actually how it works in SQL > Server 2008. In fact, there you HAVE to use that syntax; you CANNOT > refer to the select list's column alias in the group by clause. I wasn't > awa

Re: [firebird-support] What's wrong with this SQL?

2011-09-20 Thread Kjell Rilbe
Den 2011-09-20 08:43 skrev Helen Borrie såhär: > At 05:53 PM 20/09/2011, 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 "R

Re: [firebird-support] What's wrong with this SQL?

2011-09-19 Thread Helen Borrie
At 05:53 PM 20/09/2011, 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 "Rem

Re: [firebird-support] What's wrong with this SQL?

2011-09-19 Thread 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

Re: [firebird-support] What's wrong with this SQL?

2011-09-19 Thread Thomas Steinmaurer
> 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

[firebird-support] What's wrong with this SQL?

2011-09-19 Thread Kjell Rilbe
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 woul