I have two tables:
Request:
RequestID | Msg
----------------
5 | abc
6 | def
7 | ghi
8 | jkl
RequestStatus:
RequestStatusID | RequestID |StatusID
-------------------------------------
1 5 1
2 8 2
- Not every request has a record in
RequestStatus
I need all the records from table Request
except when StatusID = 2
. (requestID=8
should be filter-out)
I am using LEFT OUTER JOIN
to recieve the records from table Request
but when I am adding Where clause (Where StatusID = 1)
of course it does not work.