Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I'm copying off of Denis Teaser

Status
Not open for further replies.

monksnake

Programmer
Oct 14, 2005
2,145
US
What does the following evaluate to and which path does it take??

Code:
SELECT CASE 2 WHEN '2' THEN CASE 3 WHEN 2 THEN 5 ELSE CASE 9 WHEN 5 THEN 3 ELSE 0 END END ELSE CASE 0 WHEN 2 THEN 5 ELSE 0 END END

[monkey][snake] <.
 
I think you have a bit too much tiem on your hands over there monksnake!

(says the pot to the kettle ;-) )

Ignorance of certain subjects is a great part of wisdom
 
I wrote it up in like 2 minutes, actually did it cause I am sick of what I'm doing right now.

[monkey][snake] <.
 
Here's another one for your amusement:

Code:
declare @i integer

select case @i when 0 then 'Is it this answer'
	else 'Or is it this one' end

Ignorance of certain subjects is a great part of wisdom
 
My knowledge about SQL is limited, but I'm guessing to delcare an integer, it initializes to 0 if nothing is specified, so 'Is it this answer' is my guess.

[monkey][snake] <.
 
well, you learn something new every day :p

Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top