请教一个SQL的除法过程----在线等
数据库为:sql server2000
SQL语句为:
select distinct pname,
(select count(*) from baseinfo as a where (jjgz='1' or jjgz='2') and a.pname=b.pname ) as count1,
(select count(*) from baseinfo as a where a.pname=b.pname ) as count2 ,
(select count(*) from baseinfo as a where (jjgz='1' or jjgz='2') and a.pname=b.pname )/
(select count(*) from baseinfo as a where a.pname=b.pname ) as count3
from baseinfo as b order by count1 desc
得到的结果为:
pname count1 count2 count3
张三 1101 1104 0
如何让count3有小数点后四位或者更多呢?如何给count3加上“%”号呢?