把B表里的id,name字段数据复制到A表里. FID字段相关联。
update A set A.id = B.id, A.name = B.name where A.FID = B.FID实际运行的时候报错
无法绑定由多个部分组成的标识符“B.FID”
好像我网上找了一下是要用别名(对B表)
怎么用
update A set A.id = B.id, A.name = B.name where A.FID = B.FID实际运行的时候报错
无法绑定由多个部分组成的标识符“B.FID”
好像我网上找了一下是要用别名(对B表)
怎么用
update A set id = B.id, name = B.name from a , b where A.FID = B.FID
如何判断一个表里的字段数据是否唯一
比如 A表里的ID字段,它里面有3万条数据,它不是主键,我如何判断该字段没重复数据呢?
select id from a group by id having count(1) = 1--不唯一
select id from a group by id having count(1) > 1
update A
set A.id = B.id
,A.name = B.name
from A
,B
where A.FID = B.FID
select id from a group by id having count(1) = 1--不唯一
select id from a group by id having count(1) > 1
--唯一
select id from a group by id having count(1) = 1--不唯一
select id from a group by id having count(1) > 1up 9楼
set id = B.id, name = B.name from B where A.FID = B.FID