我的查询
UPDATE TOP (1) TX_Master_PCBA SET TIMESTAMP2 = '2013-12-12 15:40:31.593' WHERE SERIAL_NO IN ('0500030309') ORDER BY TIMESTAMP2 DESC
与表中的serial_No列TX_Master_PCBA我有10条记录,但我想将最新更新TIMESTAMP2为当前日期时间。
serial_No
TX_Master_PCBA
上面的查询抛出错误:
关键字“ TOP”附近的语法不正确。
WITH UpdateList_view AS ( SELECT TOP 1 * from TX_Master_PCBA WHERE SERIAL_NO IN ('0500030309') ORDER BY TIMESTAMP2 DESC ) update UpdateList_view set TIMESTAMP2 = '2013-12-12 15:40:31.593'