SQL update top1 row query

前端 未结 3 1834
迷失自我
迷失自我 2020-12-01 20:32

The query below is working:

update  top(1) ShipBillInfo 
set     shipfirstname=\'kkk\' 
where   CustomerId=\'134\';

but it is showing error

3条回答
  •  长情又很酷
    2020-12-01 21:24

    why dont you do :

    update ShipBillInfo 
    set shipfirstname='kkk' 
    where OrderGUID = (select top (1) OrderGUID  
                       from ShipBillInfo 
                       where CustomerId = 134 
                       order by OredrGUID desc )
    

提交回复
热议问题