MySQL Forums
Forum List  »  Newbie

subquery to join
Posted by: Jörgen Nilsson
Date: September 09, 2004 06:13PM

Is there any way to convert this subquery to a join? Does it even work in MySQL? or might be wrong to start of with :)

SELECT p.pollID, p.thepoll, a.answerID, a.answer
FROM polls AS p, pollAnswer AS a
WHERE p.pollID = SELECT MAX(pollID) FROM polls;

What I want to do is to get the last inserted row along with the data that belongs to that row from another table.

Cheers
/Jorgen

Options: ReplyQuote


Subject
Written By
Posted
subquery to join
September 09, 2004 06:13PM
September 09, 2004 06:26PM


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.