34,590
社区成员
发帖
与我相关
我的任务
分享
SQL1:
If not exist (select * from table1 where tr=’SW’)
begin
select ‘ Not Exist’;
end
else
begin
select ‘Exist’;
end
SQL2:
If exist (select * from table1 where tr=’SW’)
begin
select ‘Exist’;
end
else
begin
select ‘Not Exist’;
end
2.
select cast(year(dateadd(m,number,getdate())) as varchar(4))+'年'+cast(number as varchar(2))+'月' as ym,
day(dateadd(d,-day(dateadd(m,number,getdate())),dateadd(m,number,getdate()))) as d
from master..spt_values
where type='P' and number>0 and number <20
if @a=@b
print '相等'
else print '不相等'
if @a!=@b
print '不相等'
else print '相等'
的区别