Hello all,
I would like to JOIN two tables but there may be more matches in table 2, for example:
Code:
table 1 table 2
ID ID emailto
id1 id1 yes
id2 id1 no
id3 id1 no
I would like to match only one row from table 2 to table 1 that has a certain field not equal to 'yes'. How can I do this, I have this so far:
Code:
SELECT * from message INNER JOIN receiver ON message.msgID=receiver.msgID
WHERE (message.threadID=$threadID OR message.msgID=$calledRecord OR message.msgID=$threadID)
AND receiver.emailto=!'yes' ORDER BY message.date ASC
It seems to work but I am not so sure, anyone confirm? Am I using the right sort of JOIN?