Monday, February 27, 2012

interesting sql tidbit

this:
(
select 3 as herby
union select 1
)
order  by herby

works

with group by - it doesnt

you need:



select * from
(
select 3 as herby
union select 1
) as main
group by main.herby

No comments:

Post a Comment