--以下可行性未经验证
--有条件的插入语句:
--先查maxid
select max(id) as 'Id' from [test].[dbo].[mytable]
--用处:用maxid来避免重复插入
insert [test].[dbo].[mytable]
select '999' as 'CostItem','20220407' as 'UpdateTime','0' AS 'IsDel',null AS 'UserName','0' AS 'Schducle'
where exists (select 1 from (select max(Id) as 'maxid' from [dbo].mytable)t where t.maxid='116')
12-07
2523
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-03
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交