MySQL Forums
Forum List  »  Newbie

Re: help with a query
Posted by: William Chiquito
Date: January 31, 2007 09:52AM

Hi oliver,

Try:
select p.age as Age, a1.answer as Question1, a2.answer as Question2, a3.answer as Question3 from person p
	left join answer a1 on p.id = a1.id and a1.QuestionNo = 1
	left join answer a2 on p.id = a2.id and a2.QuestionNo = 2
	left join answer a3 on p.id = a3.id and a3.QuestionNo = 3

Options: ReplyQuote


Subject
Written By
Posted
January 31, 2007 09:26AM
January 31, 2007 09:43AM
Re: help with a query
January 31, 2007 09:52AM
thx
January 31, 2007 10:07AM


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.