dbTalk Databases Forums  

Case with NULL

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Case with NULL in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Case with NULL - 01-17-2011 , 02:44 AM






Gene Wirchenko (genew (AT) ocis (DOT) net) writes:
Quote:
On Fri, 14 Jan 2011 23:13:32 +0100, Erland Sommarskog
esquel (AT) sommarskog (DOT) se> wrote:

Gene Wirchenko (genew (AT) ocis (DOT) net) writes:
Not the adjective I would have picked.

You're not Swedish, are you? :-)

No, why?
Had you been Swedish you would have not been a native speaker of English.
And less accurate in your picking of adjectives.

Quote:
When you use CASE, you easier realise that the subquery is computed
twice.

And only once with coalesce() which would argue in favour of
using it. (Naturally, all bets are off when optimisation enters the
picture.)
No, the point is that coalesce is rewritten to the CASE experssion
internally before optimization, so the two are identical.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.