我想做一个关于彩票3D的统计程序,无非就是统计每个数字的出现次数,用的ACCESS数据库,字段分别为:0,1,2,3,4,5,6,7,8,9,字段类型为BOOL型的,比如:如果这期开奖号码为123,那么1,2,3这三个字段即为True.
我想通过统计每个字段出现的次数,然后对这些字段进行排序,再将出现次数多的前三个显示出来,后三个显示出来,中间的四个也显示出来。各位能不能帮我看看,具体应该如何写算法呀?!!谢谢!!
我想通过统计每个字段出现的次数,然后对这些字段进行排序,再将出现次数多的前三个显示出来,后三个显示出来,中间的四个也显示出来。各位能不能帮我看看,具体应该如何写算法呀?!!谢谢!!
解决方案 »
- ajax对repeater控件中的sortid列进行排序
- 控制页面刷新的问题
- 小白求教:asp.net预览出现错误:无法打开登录所请求的数据库 "DropdownTest"。登录失败。用户 'sa' 登录失败。
- 如果查找这样的控件呢?
- 有关于连接access的字符串的问题,求!
- 初学者:关于gloable.ascx中加入变量问题
- 烂书一本!《Web站点高级编程》--C#篇,读过的Fans加QQ!
- 关于网络编程,请教高手指点
- [Search]哪里有像仪表(例如汽车油表)的控件?
- 嵌入YouTube视频提示“frame because it set 'X-Frame-Options' to 'sameorigin'”
- 人民币求购B2B网站源码!帮顶有分
- web.config文件加入自定义节的问题
insert into test select 0,1,1,1,0,0,0,0,0,0
insert into test select 0,1,1,1,0,0,0,0,0,0
insert into test select 0,1,1,1,0,0,0,0,0,0
insert into test select 0,1,1,1,0,0,0,0,0,0
insert into test select 0,1,1,1,0,0,0,0,0,0
insert into test select 0,1,1,1,0,0,0,0,0,0
insert into test select 0,1,1,1,0,0,0,0,0,0
insert into test select 0,1,1,1,0,0,0,0,0,0
insert into test select 0,1,1,1,0,0,0,0,0,0
insert into test select 0,1,1,1,0,0,0,0,0,0
declare @temp table(myname varchar(2),myvalue int)
insert into @temp select '0',Sum(D0) from test
insert into @temp select '1',Sum(D1) from test
insert into @temp select '2',Sum(D2) from test
insert into @temp select '3',Sum(D3) from test
insert into @temp select '4',Sum(D4) from test
insert into @temp select '5',Sum(D5) from test
insert into @temp select '6',Sum(D6) from test
insert into @temp select '7',Sum(D7) from test
insert into @temp select '8',Sum(D8) from test
insert into @temp select '9',Sum(D9) from testdeclare @temp2 table(myname varchar(2),myvalue int)
insert into @temp2 select top 3 myname,myvalue
from @temp
order by myvalue desc
insert into @temp2
select myname,myvalue
from @temp
where (myname not in(select top 3 myname from @temp order by myvalue desc)) and (myname not in(select top 3 myname from @temp order by myvalue asc))
insert into @temp2
select top 3 myname,myvalue
from @temp
order by myvalue ascselect * from @temp2