I have SQL query design as below.
SELECT (THIS ITEMS)
FROM (TABLES)
WHERE(SOME CONDITION) AND NOT IN (CONDITION) AND IN (CONDITION)
But not getting proper output as required, as ‘IN’ condition isn’t wrking properly
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need a column to compare to. Proper syntax is (note the
column_expression):For example,
Note you can also use a single-column result set instead of a static comparison list, as in:
but it is much more optimal to use an
EXISTSclause for this case: