我正在尝试使用这样的请求对行进行非常简单的更新:
UPDATE MY_TABLE
SET LINE_TX = 1000/(SELECT AMOUNT FROM MY_TABLE WHERE LINE_ID = 1 AND LINE_ORDER = 2)
WHERE LINE_ID = 1 AND LINE_ORDER = 2;
有没有办法只使用一个where子句?
答案 0 :(得分:1)
只需引用该列:
UPDATE MY_TABLE
SET LINE_TX = 1000 / AMOUNT
WHERE LINE_ID = 1 AND LINE_ORDER = 2;