I finally got it working like I wanted it :-) SELECT DISTINCT t1.softid, IF( t1.nameofcd LIKE '%test%' OR t2.nameofsoftware LIKE '%test%', t1.nameofcd, '') AS nameofcd, IF( t2.nameofsoftware LIKE '%test%', t2.nameofsoftware, '') AS nameofsoftware FROM Table1 t1 LEFT JOIN Table2 t2 ON t1.softid = t2.softid WHERE t1.nameofcd LIKE '%test%' OR t2.nameofsoftware LIKE '%test%' ORDER BY t1.softid, t1.nameofcd, t2.nameofsoftware
Thank you all for your valuable time! Kind regards, Timon Berkowitz The Netherlands -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]