Simple question. I noticed it seems I can use them interchangeably, but I wasn't sure if they were the exact same command. I searched online and couldn't find anything? Here an example query that gives me the same result:
select
case when ID in ('1', '2', '3')
then 'Jack'
else 'Jim'
end as Person
from Table.Names
select
case when ID in ('1', '2', '3')
then 'Jack'
else 'Jim'
end Person
from Table.Names
The as
in the statement is aesthetic. It tells the compiler that you are setting a name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With