Hi all,
I did something like this and it gave me the result as 123456.please look at this and tell me how does something be derived from a blank table(set)?
Code:
create table a ( id integer);
select case when 1 = 1
then 123456
else count(*) end as NUMBER
from a
where 1 = 0;
I tried this on mysql and one of my friends -who had told me about this- says it works same on sql server.
PM: My friend said that he saw this in one of Joe Celko's columns but I could not find that column.
-Thanks in advance