K3HT
asked on
Query Question
I am trying to select records from one table if a field's contents are in another table. This is what I was thinking, although it did not work
SELECT CLIENT,LOCIX,ACCT,STATUS, FROM RMAST WHERE STATUS IN (SELECT STATUS FROM INWOSTAT) AND CLIENT = 'XBA'
Any ideas on how I would write this query to do what I am looking for?
SELECT CLIENT,LOCIX,ACCT,STATUS, FROM RMAST WHERE STATUS IN (SELECT STATUS FROM INWOSTAT) AND CLIENT = 'XBA'
Any ideas on how I would write this query to do what I am looking for?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Wow, not only did I misread the question, I then managed not to hit Submit 'til you already answered. Sorry about that!
ASKER
np, thanks for trying.
You can fall back on...
SELECT CLIENT, LOCIX, ACCT, STATUS
FROM RMAST
LEFT JOIN INWOSTAT ON (INWOSTAT.STATUS = RMAST.STATUS)
WHERE CLIENT = 'XBA' AND INWOSTAT.STATUS IS NULL;