SQL Select newest records that have distinct Name column

前端 未结 4 992
一生所求
一生所求 2020-12-12 15:30

I did search around and I found this SQL selecting rows by most recent date Which is so close to what I want but I can\'t seem to make it work.
I get an error Column \'I

4条回答
  •  猫巷女王i
    2020-12-12 15:55

    Use Distinct instead of Group By

    Select Distinct ID,Name,Price,Date
    From  table
    Order By Date ASC
    

    http://technet.microsoft.com/en-us/library/ms187831.aspx

提交回复
热议问题