SELECT t1.*, t2.thedescription AS t2desc FROM table1 AS t1 
LEFT JOIN table2 AS t2 
ON t1.linkfield=t2.linkfield WHERE t1.lookup='ZZZZZ';

Without the WHERE condition this would return all 1000 rows of table1 since "a LEFT JOIN returns all rows of the left of the condition even if there is no right column to match." but t1.lookup='ZZZZZ' constrains this to only the one row of table one with lookup equal to 'ZZZZZ'.

Posted in: MySQL

Related FAQ's

Marius Ion ANGEL HOT SOFT LLC (800) 316-7677