ON a .colsort=b.id
SET public_DataSelect .colname='公卫疾病名称' , public_DataSelect .colvalue=InfectionQuery.DiagCode +InfectionQuery.dieasename
,public_DataSelect.py =InfectionQuery.py
where InfectionQuery.id>0 and public_DataSelect .colsort=InfectionQuery.id
3 个解决方案
#1
--改成这样试试
UPDATE public_DataSelect
SET public_DataSelect.colname = '公卫疾病名称',
public_DataSelect.colvalue = InfectionQuery.DiagCode + InfectionQuery.dieasename,
public_DataSelect.py = InfectionQuery.py
FROM InfectionQuery
WHERE InfectionQuery.id > 0
AND public_DataSelect .colsort = InfectionQuery.id
#2
--正确语句如下
UPDATE a SET a.colname='公卫疾病名称',a.colvalue=b.DiagCode +b.dieasename,a.py =b.py
FROM public_DataSelect a ,InfectionQuery b WHERE a.colsort=b.id AND b.id>0
UPDATE a SET a.colname='公卫疾病名称',a.colvalue=b.DiagCode +b.dieasename,a.py =b.py
FROM public_DataSelect a ,InfectionQuery b WHERE a.colsort=b.id AND b.id>0
#3
UPDATE public_DataSelect
SET public_DataSelect.colname = '公卫疾病名称',
public_DataSelect.colvalue = InfectionQuery.DiagCode + InfectionQuery.dieasename,
public_DataSelect.py = InfectionQuery.py
FROM InfectionQuery
WHERE InfectionQuery.id > 0
AND public_DataSelect .colsort = InfectionQuery.id
#1
--改成这样试试
UPDATE public_DataSelect
SET public_DataSelect.colname = '公卫疾病名称',
public_DataSelect.colvalue = InfectionQuery.DiagCode + InfectionQuery.dieasename,
public_DataSelect.py = InfectionQuery.py
FROM InfectionQuery
WHERE InfectionQuery.id > 0
AND public_DataSelect .colsort = InfectionQuery.id
#2
--正确语句如下
UPDATE a SET a.colname='公卫疾病名称',a.colvalue=b.DiagCode +b.dieasename,a.py =b.py
FROM public_DataSelect a ,InfectionQuery b WHERE a.colsort=b.id AND b.id>0
UPDATE a SET a.colname='公卫疾病名称',a.colvalue=b.DiagCode +b.dieasename,a.py =b.py
FROM public_DataSelect a ,InfectionQuery b WHERE a.colsort=b.id AND b.id>0
#3
UPDATE public_DataSelect
SET public_DataSelect.colname = '公卫疾病名称',
public_DataSelect.colvalue = InfectionQuery.DiagCode + InfectionQuery.dieasename,
public_DataSelect.py = InfectionQuery.py
FROM InfectionQuery
WHERE InfectionQuery.id > 0
AND public_DataSelect .colsort = InfectionQuery.id