MySQL Forums
Forum List  »  Newbie

Re: select max date in Inner Join
Posted by: the devilz
Date: June 29, 2010 06:11AM

Firstly Thank you for your kind reply
and i have tried most of them and want to resolve this in dB but still not resolving the problem


As I am trying this code by following your given links but still getting error







SELECT users.userid, users.Fname, users.Sname, users.LastUpdated, useraddress.Address1, useraddress.Address2, useraddress.City, useraddress.Country, useraddress.PostalCode, useraddress.HomeNo, useraddress.MobileNo, p.Q
FROM users
INNER JOIN useraddress ON useraddress.Userid = users.Userid
INNER JOIN (SELECT MAX(last_updated) AS Q FROM invoice GROUP BY invoice.userid) AS p ON invoice.userid = users.Userid
AND TO_DAYS( invoice.last_updated ) >= TO_DAYS( '2010-6-21' )
AND TO_DAYS( invoice.last_updated ) <= TO_DAYS( '2010-6-22' )
GROUP BY users.Fname
ORDER BY `users`.`Fname` ASC



ERROR: Unknown column 'invoice.userid' in 'on clause' On line number 5

Best Regards
sK

Options: ReplyQuote


Subject
Written By
Posted
Re: select max date in Inner Join
June 29, 2010 06:11AM


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.