要相除的是什么?某个字段的统计还是数据量统计还是其他的?
select t1.a/t2.b from (
(select count(1) a from table1) t1,
(select count(1) b from table2) t2
);
declare @a int --变量1存放其中一个表统计数据
declare @b int --变量2存放另外一个表统计数据
select @a=COUNT(*) from 表1 where 统计条件
select @b= COUNT(*) from 表2 where 统计条件
print @a --打印表1统计数据
print @B --打印表2统计数据
print @a/@b --打印表1/表2值