求一特殊查询语句 这种结果?SELECT RTRIM(COUNT(DISTINCT type)) +'/' + RTRIM(COUNT(*)) FROM tb 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select px * 100.0/px2 as cntfrom (select count(distinct type) as px from ta) a,(select count(1) as px2 from ta) Declare @t table(id int identity,[type] varchar(2))Declare @a floatinsert @t select 'aa' insert @t select 'bb'insert @t select 'bb'insert @t select 'cc'insert @t select 'cc'insert @t select 'aa'insert @t select 'dd'insert @t select 'aa'Select @a=count(*) from @tSelect [type],cnt=count([type])/@a From @t group by [type]Select [type],cnt=rtrim(count([type]))+'/'+rtrim(@a) From @t group by [type]要哪个结果? 还是openrowset的问题,还得请教各位!!!! 求一条有点难度的SQL语句... 英文单词的模糊查询 varchar(50)转换成char(8),好像有点复杂? 个人决得这个动态sql语句比较难!搞了一个晚上还是不行,求救!!!! ERP项目开发工具,进者有分 如何让DTS随我的程序一起发行 想到头大,请进来一想琢磨琢磨 一道关于Update的笔试题 to: nononono(null,null),紧接刚才的GRID的刷新问题! email类型字段? sqlserver2005有114个链接但是都在sleep。导致连接超时。。。。
from (select count(distinct type) as px from ta) a,
(select count(1) as px2 from ta)
Declare @a float
insert @t select 'aa'
insert @t select 'bb'
insert @t select 'bb'
insert @t select 'cc'
insert @t select 'cc'
insert @t select 'aa'
insert @t select 'dd'
insert @t select 'aa'Select @a=count(*) from @t
Select [type],cnt=count([type])/@a From @t group by [type]
Select [type],cnt=rtrim(count([type]))+'/'+rtrim(@a) From @t group by [type]
要哪个结果?