IN SQL Statement

Question:
I have department codes like this: T, B, P, O, Q, etc. How can I find T only, B only, or others only (excluding T and B)?

Answer:
You can achieve this by using the IN statement. You could say:

 WHERE Department NOT IN ( 'T', 'B' )

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: