Nested IF statements inside SQL statement???
622829May 28 2008 — edited May 29 2008Here's what I'm trying to do. I have a select list like so:
display value
--------------------------------------
Any ANY (NULL value)
<1 0
1-3 1
4-7 4
8-10 8
11+ 11
In a table I have a number column showing the years of experience an individual has. What I need to do is if this number falls into the range, then add the user to our results. I'm having a problem though with the logic. Do I need a nested if statement or a case statement in my sql query?
My user table is structured like so:
USER table:
---------------------
ID number
EXPERIENCE number
I was originally pulling all the users, and then doing my checks inside the loop, but that's going to cause performance issues down the line. I thought about doing a SELECT CASE, but even in the case statement, I still need to see if the value of EXPERIENCE falls into the range