insert into ImgStore values(1,'asdfasd','') where
(select count(1) from ImgStore where pic_id = 'asdfasd') < 1为什么总报错,还有别的方法可以实现效果么?
(select count(1) from ImgStore where pic_id = 'asdfasd') < 1为什么总报错,还有别的方法可以实现效果么?
declare @t table(id int,myname nvarchar(10))insert into @t values(1,'asd')if((select count(1) from @t where id = 1) < 1)
insert into @t values(1,'asd')select * from @t
if((select count(1) from ImgStore where pic_id = 'asdfasd') < 1)
insert into ImgStore values(1,'asdfasd','')
if not exists (select 1 from ImgStore where pic_id = 'asdfasd')
insert into ImgStore values(1,'asdfasd','')