MySQL Forums
Forum List  »  Docs

MySql5 problem
Posted by: Adnan Raja
Date: July 06, 2007 01:00AM

SELECT t.person_person_id, CONCAT_WS(' ',p.first_name, p.last_name) left_name, relation_type, CONCAT_WS(' ',r.first_name, r.last_name) right_name FROM person_person AS t INNER JOIN person AS p ON (p.person_id = t.person_id) INNER JOIN person AS r ON (r.person_id = t.related_person_id) WHERE t.person_id = 600389 UNION SELECT t.person_person_id, CONCAT_WS(' ',p.first_name, p.last_name) left_name, relation_type, CONCAT_WS(' ',r.first_name, r.last_name) right_name FROM person_person AS t INNER JOIN person AS r ON (p.person_id = t.person_id) INNER JOIN person AS p ON (r.person_id = t.related_person_id) WHERE t.related_person_id = 600389"


This query works fine in MySQL4.1.7 but cause error in Mysql 5.0.27

Error in query: Unknown column 'p.person_id' in 'on clause'

Options: ReplyQuote


Subject
Views
Written By
Posted
MySql5 problem
6279
July 06, 2007 01:00AM
3290
July 06, 2007 06:08AM
3474
August 28, 2007 10:55AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.