Simple SQL question

Soldato
Joined
18 Oct 2002
Posts
18,306
Bit of a mental block here, but basically I have 2 tables, I want a query to select all records from table A that are NOT also in table B. How is this done?
Thanks
 
thanks truz I figured out your way, now its giving me this

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING

for this

$sql = "SELECT * FROM courses WHERE level = '$_SESSION['user']->level'
AND courseID NOT IN (SELECT courseID from subscriptions
WHERE userID = '$_SESSION['user']->userID')";
$result = mysql_query($sql);

meh, i should go to bed :/


edit - fixed that, but the query gives no output, meh :/

edit - fixed
 
Last edited:
Back
Top Bottom