List:General Discussion« Previous MessageNext Message »
From:Peter Brawley Date:November 19 2005 6:51pm
Subject:Re: Inner Join & Search on Two (2) fields ?
View as plain text  
Miles,

 >SELECT events.name_short, events.type, events.location,  
events.description, events.faculty, >concat(people2.First_Name,  
people2.Last_Name) as zName, people2.roles
 >FROM events INNER JOIN people2 ON events.faculty = people2.id
 >WHERE people2.roles = "faculty" AND zName = "some name"

 >Is this SELECT statement correct ?

Nope, you can't reference a column alias ('zname') in a WHERE clause.

PB

-----

m i l e s wrote:

> SELECT events.name_short, events.type, events.location,  
> events.description, events.faculty, concat(people2.First_Name,  
> people2.Last_Name) as zName, people2.roles
> FROM events INNER JOIN people2 ON events.faculty = people2.id
> WHERE people2.roles = "faculty" AND zName = "some name"
>
> Is this SELECT statement correct ?
>
> M i l e s.
>
>


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.4/175 - Release Date: 11/18/2005

Thread
Inner Join & Search on Two (2) fields ?m i l e s19 Nov
  • Re: Inner Join & Search on Two (2) fields ?Michael Stassen19 Nov
    • Re: Inner Join & Search on Two (2) fields ?m i l e s19 Nov
  • Re: Inner Join & Search on Two (2) fields ?Peter Brawley19 Nov