Jump to content

GROUP BY help...


ajlisowski

Recommended Posts

Hey all, I was wondering if there was a way to filter what row of data gets returned when using GROUP BY.

 

For example, lets say I have two rows

idnamevalue 1value 2

1Batman1015

2Batman2025

 

 

If I do

SELECT * FROM `table` GROUP BY `name` 

how can I know which id, value 1 and value 2 I am going to get? I would like to be able to specify that I would want to get the results for the one with the highest value 2. Is that possible? So of an ORDER BY within the GROUP BY?

Link to comment
https://forums.phpfreaks.com/topic/236535-group-by-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.