簡體   English   中英

如何在關鍵字“ where”附近修復錯誤的語法

[英]How to fix Incorrect syntax near the keyword 'where'

此SQl語句Incorrect syntax near the keyword 'where'.引發Incorrect syntax near the keyword 'where'.錯誤Incorrect syntax near the keyword 'where'. 我不確定是什么問題。 這只是一個更新語句,我正在嘗試從另一個表中獲取user_id,其中user_name是這個表。

聲明:

update esg.client_user_pref where client_user_id = (select U.CLIENT_USER_ID from esg.CLIENT_USER U where U.USER_NAME='CorpESignClientUser') and pref_entity = 'UsageMode' and pref_attrb = 'ExpirationAfterDay' set pref_value = '15';

謝謝

錯誤的順序:

右:更新...設置...在哪里...

錯誤:更新...在...設置

UPDATE查詢的正確語法是

UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;

根據您上面的代碼,AS應該可以解決問題

     update table esg.client_user_pref 
 set pref_value = '15'
 where client_user_id = 
 (select U.CLIENT_USER_ID from esg.CLIENT_USER U where U.USER_NAME='CorpESignClientUser') 
 and pref_entity = 'UsageMode' and pref_attrb = 'ExpirationAfterDay' ;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM