向高手求救
SELECT 时如果没有符合条件的数据,怎样将其设置为零在结果集中显示 问题点数:20、回复次数:1Top
1 楼simonhehe(流氓会武术,谁也挡不住)回复于 2006-05-01 16:38:53 得分 0
create table tableA(sStr int)
insert into tableA select 2
union all select 3
go
declare @str int
set @str=4
if((select count(1) from tableA where sStr = @str)<=0)
select top 1 sStr = '0' from tableA
else
select sStr from tableA where sStr = @str
--drop table tableATop




