mysql - Select * from table1 where JID is not in table2 with table2.uid also not being 11111 -
I want to select everything from the table one, in which there is a column JID. These are the things that players can learn but one Table 2 is where a player has a list of things already learned. So if JID is in Table 2, then it has been learned, and I do not want to be selected from Table 1.
For XMPPell Table 1 JID Title Description Ranks
Table 2 JID UserID value1 value2
Table 1 can contain 100 rows, but if table 2 has 9 z Some tables are from 1, so I do not want to select them. What's more, it's specific to the User ID in Table 2. That's why I need to filter table 2 by JD! = JIID match in Table 1, but only if userID = a php variable is passed.
Hope this makese sense. I do not want to do a subquery I think it is possible to use the left external participant on JID, but I'm not sure how to invite USERID ... help!
The PS JID can be in Table 1 and Table 2 if the UID does not match ... If it matches, Jedi can be selected in Table 2.
is not present with:
SELECT t1. * Table 1 is not available from T1 (where Table 2 T2 is WHLECT T2.UID = 'php var' and t1.JID = t2.JID)
with left joining:
SELECT select t1 * Table 1 t1 from left to t1.JID = t2.JID and t2.UID = 'php var' on table 2 T2 join WHERE t2.JID null
Comments
Post a Comment