Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread CASE vs IF
Tue, Jul 13 2010 8:49 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

In a "simple" sql statement, in general terms, is it better (ie does it run faster) to use CASE rather than IF? I'm rapidly coming to the conclusion that CASE is more readable than nested IFs.

Roy Lambert
Tue, Jul 13 2010 6:40 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< In a "simple" sql statement, in general terms, is it better (ie does it
run faster) to use CASE rather than IF? I'm rapidly coming to the conclusion
that CASE is more readable than nested IFs. >>

It really doesn't matter in terms of performance - both are compiled into
similar structures for execution.

--
Tim Young
Elevate Software
www.elevatesoft.com
Wed, Jul 14 2010 2:47 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


Thanks, and in that case I'll use CASE Smiley

Roy Lambert
Image