我正在尝试将表中一列(字符串)中的所有值更改为全部小写字母。我试过这个说法:
update LoanerHeader t1 set Requester = (select LOWER(Requester) from LoanerHeader t2 where t2.ISO_ID = t1.ISO_ID)
但出现以下错误:
Incorrect syntax near 't1'.
您不需要使用子查询。你可以这样做:
UPDATE LoanerHeader SET Requester = LOWER(Requester);
update LoanerHeader t1
set t1.Requester = (
select LOWER(t2.Requester) from LoanerHeader t2
where t2.ISO_ID = t1.ISO_ID)