update A set A.COLUMN2=(select distinct(B.COLUMN2) from B where B.ID=A.ID ); ...
问题:a表中有单位,b表中也有单位,现在要替换a表中的所有单位编号,需要查询B表 相当于单位表 mysql 和SqlServer都可以使用 UPDATE sys teleuser aset deptcode select DISTINCT dept id from sys dept b where b.dept name a.DeptName ...
2020-04-02 17:06 0 2255 推荐指数:
update A set A.COLUMN2=(select distinct(B.COLUMN2) from B where B.ID=A.ID ); ...
接着之前写的一篇文https://www.cnblogs.com/lingyejun/p/11915413.html 做什么事情 更新book_borrow表,设置其中的student_name为student表中的name,关联条件为book_borrow.student_id ...
//查询更新 更新后的数据查询只能出现一个值. 否则报错. Update CAT_P_BUILDING_PRICE A set A.APPROVAL_PRICE = (Select TARGET_APPROVAL_PRICE FROM_NO from ...
案列: 想更新A表的name字段,由于失误,在写这个表的时候,这个字段没有写,发现的时候,已经写了一个多月的数据了。改了之后的过程,会正常的写这个字段, 可是已经写了的数据也不能铲了,重新计算。 好在A表的name是可以从B表通过code关联查出来的。 于是,就有了下面这句 ...
mysql PostgreSQL 参考: 1)mysql 把select结果update更新到表中,从查询结果中更新数据 2) mysql和Postgresql通过查询进行更新区别 ...
select * from crs_i18n where i18n_code in (SELECT i18n_code FROM crs_i18n GROUP BY i18n_code HAVING COUNT(i18n_code)>1 ); //根据一个字段查询 SELECT ...
附带SqlServer用法链接 https://www.cnblogs.com/w-yu-chen/p/12314960.html 进入正题: 1、用到MySQL的FIND_IN_SET()函数,请自行查阅API,这里只解决问题。 2、业务表存储的数据 3、字典表 ...