举个例子给你:
declare @a int
declare @b int
select @a=count(*) from sysobjects where name like '%sys%'
select @b=count(*) from sysobjects where name like '%set%'
select @a-@b
赞同
检举 | 2011-10-21 10:18 lchy0987 | 十一级
举个例子给你:
declare @a int
declare @b int
select @a=count(*) from sysobjects where name like '%sys%'
select @b=count(*) from sysobjects where name like '%set%'
select @a-@b
从数据库读取出来,然后将读取的内容赋值给变量
select (select Count(*) from users) usercount,(select Count(*) from ProgramModuleCodes) pcount ,((select Count(*) from ProgramModuleCodes)-(select Count(*) from users)) chabie
我也简单的给些了一个SQL语句 ,,,
count返回的就是整型,直接int