Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #1169

Re: how to use case in sql query

From Erland Sommarskog <esquel@sommarskog.se>
Newsgroups comp.databases.ms-sqlserver
Subject Re: how to use case in sql query
Date 2012-07-09 23:47 +0200
Organization Erland Sommarskog
Message-ID <XnsA08BF1FB74AEDYazorman@127.0.0.1> (permalink)
References <jtf216$633$1@dont-email.me>

Show all headers | View raw


Tony Johansson (johansson.andersson@telia.com) writes:
> I tried below but I get error probably of not understanding this fully.

And the error message is? At a glance it looks correct, but you
know error messages are damned helpful at times.

Then again, Bob's suggestion is worth pursuing, since that could
permit the optimizer to use a plan that evades a sort. With long
ORDER BY you have, the sort is inevitable.


-- 
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Find similar


Thread

how to use case in sql query "Tony Johansson" <johansson.andersson@telia.com> - 2012-07-09 18:48 +0200
  Re: how to use case in sql query "Bob Barrows" <reb01501@NOyahooSPAM.com> - 2012-07-09 15:13 -0400
  Re: how to use case in sql query Erland Sommarskog <esquel@sommarskog.se> - 2012-07-09 23:47 +0200

csiph-web