代码解释 INSERT INTO KD_part(obj_id,name,identityno,specification,Material,SourceType,MaterialNo) select min(obj_Id),isnull(name,''),isnull(identityno,''),isnull(Specification,''),isnull(Material,''),SourceType,isnull(MaterialNo,'') from t_part where SourceType in( '000000000002000000001020','000000000004000000001020') and isnull(MaterialNo,'') != '' group by isnull(name,''),isnull(identityno,''),isnull(Specification,''),isnull(Material,''),SourceType,isnull(MaterialNo,'') having count(*) > 1;
时间: 2023-04-01 13:02:44 浏览: 100
这是一段 SQL 代码,它的作用是将 t_part 表中 SourceType 字段为 '000000000002000000001020' 或 '000000000004000000001020',且 MaterialNo 字段不为空的记录按照 name、identityno、Specification、Material、SourceType、MaterialNo 字段进行分组,取每组 obj_Id 最小的记录,插入到 KD_part 表中。
阅读全文