Re: SQL statement question
From: Joe Celko (joe.celko_at_northface.edu)
Date: 03/05/04
- Next message: Louis Davidson: "Re: customize getdate() function"
- Previous message: Steve Kass: "Re: Problems with Getting a Date (range)"
- In reply to: Isaac Blank: "Re: SQL statement question"
- Next in thread: Anith Sen: "Re: SQL statement question"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 05 Mar 2004 12:11:38 -0800
>> have always thought order of evaluation in CASE expressions is
always top to bottom. If that's true, then one can save a few CPU
cycles: <<
Yep! I saw that after I posted what makes this more embarassing is that
I have a tutorial example in which there are four possible cases and one
of them has an ugly bit of logic.
I first do it with the complex case in the first WHEN clause, followed
by the others. Then I re-arrange the WHEN's so that the complex WHEN
becomes the ELSE because the three simple cases exhausted everything.
"We must fall back upon the old axiom that when all other contingencies
fail, whatever remains, however improbable, must be the truth." --
Sherlock Holmes
--CELKO--
===========================
Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, datatypes, etc. in your
schema are.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
- Next message: Louis Davidson: "Re: customize getdate() function"
- Previous message: Steve Kass: "Re: Problems with Getting a Date (range)"
- In reply to: Isaac Blank: "Re: SQL statement question"
- Next in thread: Anith Sen: "Re: SQL statement question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|