SQL tutorial | Interview questions | Oracle
Would you like to react to this message? Create an account in a few clicks or log in to continue.

How To Use IN Conditions?

Go down

How To Use IN Conditions? Empty How To Use IN Conditions?

Post by Micheal Sat Jan 16, 2010 9:23 pm

An IN condition is single value again a list of values. It returns TRUE, if the specified value is in
the list. Otherwise, it returns FALSE.
Some examples are given in the script below:
SELECT CASE WHEN 3 IN (1,2,3,5) THEN
'TRUE' ELSE 'FALSE' END FROM DUAL;
TRUE
SELECT CASE WHEN 3 NOT IN (1,2,3,5) THEN
'TRUE' ELSE 'FALSE' END FROM DUAL;
FALSE
SELECT CASE WHEN 'Y' IN ('F','Y','I') THEN
'TRUE' ELSE 'FALSE' END FROM DUAL;
TRUE

Micheal
Admin

Posts : 243
Join date : 2010-01-10

http://sql-tutorial.co.cc

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum