使用SQL數據庫時,我想將表(workflowoutputcadas
)中的一列(nonexcludedsites
)更新爲特定行(40-50)的特定值。我所做的是這樣的:在SQL中,我想將特定行更新爲新值
update workflowoutputcadas
set nonexcludedsites = 1
FROM
(SELECT ROW_NUMBER()
OVER (ORDER BY nonexcludedsites) AS Row,
nonexcludedsites
FROM workflowoutputcadas) AS w
WHERE Row between 40 and 50
因此,對於這個例子,我想的是,我想行40-50被更新爲1,其餘是相同的。當我運行腳本,它結束了將整列更新爲1這不是我想要做的,你知道我在哪裏犯了錯誤嗎?
是表中'row'列? – Jens
好吧,你應該使用'UPDATE w'代替 – Lamak
不,行不是我桌子上的一列。 – user2128119