SQL Selecting multiple columns based on max value in one column

后端 未结 6 1655
天涯浪人
天涯浪人 2021-02-07 12:22

OK so I have looked theough the other solutions an no help. So here is what I am trying to do. I need to select the row with multiple columns where the value in one column is th

6条回答
  •  醉梦人生
    2021-02-07 13:09

    I wouldn't even use Max. Just combine GROUP BY and ORDER BY

    SELECT * FROM orders GROUP BY item_number ORDER BY orderfileid DESC
    

    then for minimum just change to ASC

提交回复
热议问题