RE: Why does this fail

2005-08-16 Thread Andrew Hargreaves
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 16 August 2005 15:04 To: Andrew Hargreaves Cc: mysql@lists.mysql.com Subject: Re: Why does this fail "Andrew Hargreaves" <[EMAIL PROTECTED]> wrote on 08/16/2005 09:13:56 AM: > Can anyone e

Re: Why does this fail

2005-08-16 Thread SGreen
"Andrew Hargreaves" <[EMAIL PROTECTED]> wrote on 08/16/2005 09:13:56 AM: > 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

RE: Why does this fail

2005-08-16 Thread Andrew Hargreaves
Isn't AS optional? -Original Message- From: Raz [mailto:[EMAIL PROTECTED] Sent: 16 August 2005 14:19 To: Andrew Hargreaves Cc: mysql@lists.mysql.com Subject: Re: Why does this fail For a start, spot the missing AS... raz -- No virus found in this incoming message. Checked by AVG

RE: Why does this fail

2005-08-16 Thread Jay Blanchard
[snip] 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

Re: Why does this fail

2005-08-16 Thread Scott Noyes
> 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 > PrsnAddres

RE: Why does this fail

2005-08-16 Thread J.R. Bullington
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, u

Re: Why does this fail

2005-08-16 Thread Raz
For a start, spot the missing AS... raz -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]