1. select * from
    2. (select no=row_number() over(partition by Bid order by getdate()),* from BidWinningNotice) t
    3. where no=1 AND SID=238 AND BWMType=1