I need to get only those rows which dont have the corresponding entry in the right table advlabel , so I am doing a full left outer join :
SELECT newparsed.seqid,newparsed.wordindex,label,arg1,arg2,sublabel FROM newparsed
LEFT OUTER JOIN advlabel ON ((`advlabel`.`seqid` = `newparsed`.`seqid`) AND (`advlabel`.`wordindex` = `newparsed`.`wordindex`))
WHERE sublabel = NULL
So is the above query correct sublabel is a column from the right side table advlabel ?
both tables have primarykey(seqid,wordindex)
Best Answer
Here is an example :
So in your case, it will most likely be :
You just have to use
LEFT JOIN
and select any field (I suggest aprimary key
) in the right table that isNULL