sql_language thread: Using 'Top' in an update statement
> I'd like to update the top 500 records only in a table. It > would be helpful to understand if this clause can be used in > an update statement, and the syntax for using a specified > number as well as a percentage. > this one will update the top 5 percent: update orderid set shipvia=1 from orders o1 where 5> (100*(cast((select count(*) from orders where orderdate<o1.orderdate) as real)/ cast((select count(*)from orders) as real)))
|





