Selecting values from one table only if a column does not match the values in the column of another table in MYSQL -
I am using this query:
SELECT u.name, u Lastname, U.username as user, IMEMO = '7' in iemem and i.user = u.keyid
To get all user data, if the user That is the table inmeeting for the ID of that particular meeting (which means the user was present) (this will be why i.memo = 7).
Now I have to write another query that let me all the other user's data which were not in that meeting. I have written it like this:
select u.name, u.lastname, u.username as user u, i IEMEO = '7' and i.user & Lt; & Gt; U.keyid
However with this query I get every user twice !! I can not understand what I'm doing or doing wrong. (Okay, I think this last one can be done with a sub-quote, but I'm hoping for a little more beautiful Was). Any ideas?
You can try it with
SELECT u. Name, u.lastname, u.username is not U.Cid as a user (selection i.user fROM inmeeting where i.memo = '7')
Comments
Post a Comment