|
-
IF statement within a Where?
I have some simple SQL that I need to dynamically modify the where within the SQL.
Essentially I am trying to get:
Select*
from Stuff
where state = 'AZ'
and case when :input = 'Phx' then Area_code = '502'
else area_code = '480'
have 2 sets of criteria that I need to be used depending on the input. One is default, the other sets a diff criteria.
Many thanks in advance to all and sundry.
Get me a shrubbery.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|