SELECT * FROM supermag.smspecrlbase WHERE CONCAT(CONCAT(basedocid,basedoctype),basespecitem) NOT IN (SELECT CONCAT(CONCAT(docid,doctype),specitem) FROM supermag.smspec)
SELECT * FROM supermag.smspecrlbases t1 LEFT JOIN supermag.smspec t2 ON CONCAT(CONCAT(t1.basedocid, t1.basedoctype), t1.basespecitem) = CONCAT(CONCAT(t2.docid, t2.doctype), t2.specitem) WHERE t2.docid IS NULL