I am trying to do this in one query but not sure if it's possible or not.
Table A:
id, uId, pinId
Table B:
id, pinId, ccId
I am trying to grab all of the pinId for specified uId that do not show up in table B matching ccId specified.
So a SELECT pin FROM TABLEA WHERE uId = 2 gets me all of the pinId I need however, if one of the pin codes show up in Table B with the specified ccId I don't want it to return in the results.
2007-11-13
03:07:03
·
5 answers
·
asked by
Jeff Lewis
2
in
Computers & Internet
➔ Programming & Design
Am using mySQL 4 and MINUS seems to throw an error when using this statment:
SELECT pin FROM pincodes WHERE uId = 26 MINUS SELECT pin FROM pincodes_log WHERE cc_id = 22
2007-11-13
03:20:37 ·
update #1