From: Peter Brawley Date: November 19 2005 6:51pm Subject: Re: Inner Join & Search on Two (2) fields ? List-Archive: http://lists.mysql.com/mysql/191901 Message-Id: <437F743C.7000102@earthlink.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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