1
插入多行我使用SQL Server 2008和与其他线程的帮助下,我已经能够写:基于SELECT语句
insert into fml0grant (auto_key, roleid)
select fml0.auto_key, 20
from fml0
left join fml0grant on fml0.auto_key = fml0grant.auto_key
where fml0.dwgname <> ''
and fml0grant.roleid is null
但是我需要做的是插入多行每条记录都在where子句中找到。所以当where子句得到一个结果,我需要插入:
- fml0.auto_key,20
- fml0.auto_key,508
- fml0.auto_key,10
有什么办法将所有三个插入组合成一个语句,就像在查询中的第一个语句之后,WHERE子句中的NULL不再为真。
这个问题不清楚,请看看[这里](https://spaghettidba.com/2015/04/24/how-to-post-at-sql-question-on-a-公共论坛/)如何改善问题.. – TheGameiswar