|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have two tables:
Table one: user_name, address (the user_name is unique) Table two: user_name, prices (this one allows duplicate user_name and prices) I want to pick draw up a list of user_names with the highest prices. What is the correct way of joining the two tables? |
|
#2
|
|||
|
|||
|
If you don't need the address you don't need the first table.
select user_name,max(prices) as top_price from table_two group by user_name order by top_price; |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > mySql query, urgent help please |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|