below script to update top 5 row a column, into same table:
update tbl_user set user_gift= '99' from (select top 5 user_id from tbl_user ) a where tbl_user.user_id =a.user_id
and below for table:
user_id user_name user_gift
-------- ------------ -------------
1 user01 99
2 user02 99
3 user03 99
4 user04 99
5 user05 99
6 user06 00
7 user07 00
Saturday, November 13, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment