SELECT * FROM HrmDepartment WHERE supdepid ='71' 我想将这条查询出来的数据,以cxsybmid表的字段名称为条件,引用到cxsybmid表中
时间: 2024-04-08 13:31:13 浏览: 36
select form where 语句
好的,您可以使用以下SQL语句将查询结果插入到"cxsybmid"表中:
```sql
INSERT INTO cxsybmid (id, departmentmark, departmentname, supdepid, topid)
SELECT id, departmentmark, departmentname, supdepid, topid
FROM HrmDepartment
WHERE supdepid = '71';
```
这条SQL语句将会将"HrmDepartment"表中"supdepid"字段为'71'的记录插入到"cxsybmid"表中,保留相同的字段值和数据。请确保目标表"cxsybmid"已经事先创建,并且字段名称与源表"HrmDepartment"一致。
阅读全文