有一个table有a1,a2,a3,a4等4个integer型字段,现要求:
如何用max这个函数在一条SQL语句中求出四个字段的公共的最大值. select max(x) from
(select a1 x from table
union
select a2 x from table
union
select a3 x from table
union
select a4 x from table) 好象行是行﹐就是又笨又慢﹐
有更好的嗎﹖
如何用max这个函数在一条SQL语句中求出四个字段的公共的最大值. select max(x) from
(select a1 x from table
union
select a2 x from table
union
select a3 x from table
union
select a4 x from table) 好象行是行﹐就是又笨又慢﹐
有更好的嗎﹖
解决方案 »
- 跪求:用AdoDataset的UpdateBatch方法插入数据,如何得到每条新增记录的自增ID号?
- delhpi 子form怎么调用主form 的MainMenu1的子项属性呢?
- blazingfire 来回答问题拿分吧
- 急聘Delphi软件工程师(北京上地)
- fr的“页面设置”对话框在程序中如何调出?
- 哪种报表工具支持unicode?表中有中、英、日文,用quickreport显示为乱码?
- DBGrid:如何取得当前选中纪录的某字段值:(调试通过立即给分)
- 请问一下如何给无边框窗体添加任务栏右键菜单?delphi 2010 不行。delphi7设置为none一样有。。。2010的bug?
- delphi开发淘宝客户端例程
- 如何在win98下防止除了默认用户以外的任何用户登陆啊?
- 如何在TForm中获知焦点在哪个控间上?
- bde5。1的下载网只
select max(x)
from (select max(a1) as x from table
union
select max(a2) as x from table
union
select max(a3) as x from table
union
select max(a4) as x from table
)
(select max(a1) x from table
union
select max(a2) x from table
union
select max(a3) x from table
union
select max(a4) x from table)
DB: access 2000
记录条数:229700使用第一种方法3,4秒
使用第二种方法1,2秒靠,这么快,是不是我的测试数据太单一了?