有一组数字 0,1,2,3,4,5,6,78845456723452342341123412341234123412346345634567456745474567.现在要选出百分比在为1%的数字,基础数为0,1,2,3,4,5,6,7,8,9
解决方案 »
- 一个关于datatable的问题
- 求最优SQL语句
- 各位高手为什么我的treeview控件在服务器上运行正常,但是+-图标就不能显示???
- 输入字符串格式不正确
- 求正则表达式,谢谢:)
- 在框架中怎样实现注销功能???
- 怎样做网上餐饮管理收银系统 (POS) 谢谢大家帮忙
- asp.net中调用存储过程执行插入数据后 如何 能取得到存储过程的返回值 (大伏天穿雪地棉 羽绒服 跪求解)
- 为什么用,Directory.GetCurrentDirectory()返回的结果是:C:/windows/system32
- asp.net如何使用类似与asp中的包含语句?
- 请问天气预报的功能怎么写呢?谁有天气预报的开源代码?
- asp.net网站发布问题
declare @hh table (number int ,pre float )
insert into @hh (number)
select 2 union all
select 4 union all
select 5 union all
select 6 union all
select 7 union all
select 8 union all
select 8 union all
select 3 union all
select 2 union all
select 2 union all
select 34 union all
select 3 union all
select 6 union all
select 6
--select * from @hh
DECLARE @hhcount float
SELECT @hhcount=count(number) FROM @hh
UPDATE @hh
SET pre =number/@hhcount;
select * from @hh
----------- ----------------------
2 0.142857142857143
4 0.285714285714286
5 0.357142857142857
6 0.428571428571429
7 0.5
8 0.571428571428571
8 0.571428571428571
3 0.214285714285714
2 0.142857142857143
2 0.142857142857143
34 2.42857142857143
3 0.214285714285714
6 0.428571428571429
6 0.428571428571429
to maco_wang : 你给的那个我还得看看 ,没弄明白呢
declare @dd table (关键词 varchar(4))
insert into @dd
select '诗词' union all
select '诗词' union all
select '诗词' union all
select '文章' union all
select '文章' union all
select '生活' union all
select '品味'
declare @hh varchar(2000)
set @hh='生活,文章';
SELECT charindex(',',@hh);
SELECT substring(@hh,1,charindex(',',@hh)-1);
SELECT substring (@hh,charindex(',',@hh)+1 ,len(@hh));
SELECT count(*) FROM @dd WHERE 关键词=substring(@hh,1,charindex(',',@hh)-1);
SELECT count(*) FROM @dd WHERE 关键词=substring (@hh,charindex(',',@hh)+1 ,len(@hh));