First glance -- It's missing a comma (,) between T1.BldgName and T1.StreetName, Missing a period (.) in PstlAddr T1 and in PrsnAddress T2
Also, how does the system know the table names if you are putting them first, (i.e. shouldn't it be BldgName.T1 not vice versa)? You don't define what T1 is, unless they have somehow skipped using the AS statement (and without seeing the table structure, you don't know if this is an alias or the true table name). Of course, I am not the expert on this list, just some common SQL sense. J.R. -----Original Message----- From: Andrew Hargreaves [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 16, 2005 9:14 AM To: mysql@lists.mysql.com Subject: Why does this fail Can anyone explain why this SQL statement would fail? A friend was asked it in a pre-interview assessment and it threw him a bit. SELECT T1.BldgName T1.StreetName, T1.Locality, T1.PostTown from PstlAddr T1 Where T1.City='London' AND NOT EXISTS (SELECT T2.Pstl_Address_PK from PrsnAddress T2) -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.338 / Virus Database: 267.10.10/73 - Release Date: 15/08/2005 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]