I have a table in MSSQL as below :

I want to create a sql to select last bid record grouped by each productID.
So the result will be 3 records (row 13, row 15 and row 17).
My current sql is something like this :
select top 1 *
from Bid
order by bidDate desc
group by productID
There is an error shown :
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'group'.
Anyone can help me?
The correct syntax near group by may be, unless you are in mysql, because you can’t SELECT * in a GROUP BY query.
To solve your problem you can: