How to select data where a field has a min value in MySQL?

后端 未结 7 1281
半阙折子戏
半阙折子戏 2020-12-02 17:02

I want to select data from a table in MySQL where a specific field has the minimum value, I\'ve tried this:

SELECT * FROM pieces WHERE MIN(price)
         


        
7条回答
  •  無奈伤痛
    2020-12-02 17:31

    To make it simpler

    SELECT *,MIN(price) FROM prod LIMIT 1

    • Put * so it will display the all record of the minimum value

提交回复
热议问题