VB6 ACCESS里面 表名是表名1
格式如下
日期 奖金 迟到扣钱
20090105 500 50
20120101 400 100
20120107 300 150
20120113 300 150
20120114 400 100
..........................如何查询 奖金和迟到扣钱 里 出现次数最多的一个数字,二行同时分别查询,分别显示在TEXT1和text2里面(要精确查询,同时出现2个或2个以上全部显示在TEXT里面)请问怎么实现这个查询,该使用什么语句???、很困扰
格式如下
日期 奖金 迟到扣钱
20090105 500 50
20120101 400 100
20120107 300 150
20120113 300 150
20120114 400 100
..........................如何查询 奖金和迟到扣钱 里 出现次数最多的一个数字,二行同时分别查询,分别显示在TEXT1和text2里面(要精确查询,同时出现2个或2个以上全部显示在TEXT里面)请问怎么实现这个查询,该使用什么语句???、很困扰
解决方案 »
- 数列问题!
- 100分求教!如何用正则表达式过滤掉字符串内容仅为英文大小写字母和数字的字符串,谁能写出可行的代码,独得50分!
- Image控件,马上结贴。
- 如何实现一个Server对多个Client的数据通讯?
- 紧急求助
- 求教,该问题如何解决
- 100分求Graph32.ocx文件,收到一定给分,我的坏掉了,又急用,而且没有VB安装盘,麻烦给我发一份
- 如何在不知串口参数的情况下调试串口,找到通讯参数?高分相送.
- "=SUM(R[-5]C:R[-1]C)"和Application.WorksheetFunction.Sum的区别----急
- 求助:关于winamp的插件
- sqlserver查询出来的一列怎么显示成flexgrid的列名
- 急急急,求大神们帮我解决VS2010 serialport 发送和接收汉字的问题!
strquery = "select * from 表名1 where 日期 >= " & Trim(Text9.Text) & " and 日期 <= " & Trim(Text10.Text) & ""
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = strquery
Adodc1.Refresh
create table t_test_tb as select * from
(
select 20090105 as fdate, 500 as Bonus, 50 as Deduct from dual
union
select 20120101, 400, 100 from dual
union
select 20120107, 300, 150 from dual
union
select 20120113, 300, 150 from dual
union
select 20120114, 400, 100 from dual
)--奖金出现最多次数
select *
from (select bonus, count(1) as counted
from t_test_tb
group by bonus
having count(1) > 1)
where counted = (select max(counted)
from (select bonus, count(1) as counted
from t_test_tb
group by bonus
having count(1) > 1)
)
--结果
BONUS COUNTED
---------- ----------
400 2
300 2
--罚金出现最多次数
select *
from (select Deduct, count(1) as counted
from t_test_tb
group by Deduct
having count(1) > 1)
where counted = (select max(counted)
from (select Deduct, count(1) as counted
from t_test_tb
group by Deduct
having count(1) > 1))
--结果
DEDUCT COUNTED
---------- ----------
100 2
150 2