2017-05-13 34 views

回答

0

語法運行此更新表中的記錄是

update <table_name> 
set <column_name_1>=<new_value> [, <col_name_2>=<new_value_2> ...] 
where <condition>; 

所以,你的查詢將看起來像

update TableX 
set ColumnY='New Content' 
where ColumnZ > 2886 and ColumnZ <3475; 

更新

正如提到的A C

如果ColumnZ持有浮點數,那麼上面的查詢將返回所有這樣的記錄,其中ColumnZ ∈ (2886,2887]ColumnZ ∈ [3474,3475)

要在這種情況下,模型中的條件,你應該照顧的限制(包括或不包括)和列的類型。

+2

請注意,該查詢將包括例如, 2886.5在更新中,而@BorLaze中的一個不會。然而,這個查詢可以被重寫爲'where ColumnZ> = 2887和ColumnZ <= 3474'來使它們等價。 –

1
update TableX 
set ColumnY = 'zzz' 
where ColumnZ between 2887 and 3474