How to exclude sub type in a SQL query?
Hi there,
My question could be stupid to ask but I like to create a SQL query for following situation: I have two types and some sub_types (we don't know what we have here) in a table X:
Type A (sub_type 1, 2, 3, 4)
Type B (sub_type 1, 2, 3)
I want to select the type that without sub_type 4, such as type A.
select type from X where
1. sub_type <> 4, which will give me both type A and B
2. sub_type in (1, 2, 3), which gives me both type A and B as well
Any suggestions?
Thanks,
Ning