I'm using the following SQL, which works against 2005 but fails against 2000:
select "table1"."LevelKey" AS "level0key",
case when "table1"."UnitCode" in ('012201', '09C202', '10C010')
then 'A'
else 'B' end AS "levelkey",
sum("table2"."Total") AS "Total"from "t_mlcdm_d_businessGrp" "table1",
"t_mlcdm_f_facilitySnapshot" "table2"where
"Table1"."levelKey" = "Table2"."GrpKey"
Group by "Business_Grp"."BusinessGrpAbbrev",
case when "Business_Grp"."GLUnitCode" in ('012201', '09C202', '10C010')
then 'A'
else 'B' end
havingcase when ("Business_Grp"."GLUnitCode" in ('012201', '09C202', '10C010'))
then 'A'
else 'B' end = 'A'
If I replace the case portion with something like:
case
when ("Business_Grp"."GLUnitCode" = '012201' then 'A'
when ("Business_Grp"."GLUnitCode" = '09C202', then 'A'
when ("Business_Grp"."GLUnitCode" = '10C010' then 'A'
else 'B'
end
Then it works in Sql2000. Is this a MSql 2000 bug