Documentation Home
MySQL Tutorial
Related Documentation Download this Excerpt
PDF (US Ltr) - 196.8Kb
PDF (A4) - 197.5Kb


MySQL Tutorial  / Examples of Common Queries  /  Maximum of Column per Group

7.3 Maximum of Column per Group

Task: Find the highest price per article.

SELECT article, MAX(price) AS priceFROM   shopGROUP BY articleORDER BY article;+---------+-------+| article | price |+---------+-------+|    0001 |  3.99 ||    0002 | 10.99 ||    0003 |  1.69 ||    0004 | 19.95 |+---------+-------+