MySQL Forums
Forum List  »  Source, Builds, Binaries

Inner Join Vs Max Problem
Posted by: john siswoyo
Date: January 15, 2007 07:45AM

====================
Id Name
====================
1 a
2 b
3 c

Table X2
================================================== =======
Id IdX1 Price Description
1 1 100 AA
2 1 200 BB
3 2 300 CC
4 2 400 DD

i want result Be :

Name Max_Price Description
================================================== =
a 200 BB
b 400 DD


BEFORE i use :
select x1.name, max(x2.Max_Price) as maxprice, x2.description from x1 INNER JOIN x2 on x1.id=x2.idX1 group by name,description order by Name ASC; but this script will show all row in table X2. How to Break it ?

Options: ReplyQuote


Subject
Views
Written By
Posted
Inner Join Vs Max Problem
5383
January 15, 2007 07:45AM
2319
January 15, 2007 04:52PM


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.