易截截图软件、单文件、免安装、纯绿色、仅160KB

ORACLE关于sql语句优化问题

用到如下语句:
select A,B,C from tableName where
TO_CHAR(A,'yyyy-MM-dd') like '2009-11-09' and B = '600' and A = (select max(A) from tableName where B = '600')
or TO_CHAR(A,'yyyy-MM-dd') like '2009-11-09' and B = '603' and A = (select max(A) from tableName where B = '603')
or TO_CHAR(A,'yyyy-MM-dd') like '2009-11-09' and B = '606' and A = (select max(A) from tableName where B = '606')
or TO_CHAR(A,'yyyy-MM-dd') like '2009-11-09' and B = '609' and A = (select max(A) from tableName where B = '609')
or TO_CHAR(A,'yyyy-MM-dd') like '2009-11-09' and B = '611' and A = (select max(A) from tableName where B = '611')

上述代码中,重复部分比较多,能否简化??
select A,B,C from tableName where
TO_CHAR(A,'yyyy-MM-dd') like '2009-11-09' and B in('600','603','606','609','611') and A = (select max(A) from tableName where B in('600','603','606','609','611'))




select A,B,C from tableName a where
TO_CHAR(A,'yyyy-MM-dd') = '2009-11-09'
and b in('600','603','606','609','611')
and a=(select max(a) from tablename where b=a.b)

引用


相关问答:

csv文件转换成sql导入到数据库,没有数据为何?

执行的顺序:
1)文件浏览框(选择文件使用)
选择好文件后
点击一个导入按钮的时候 ,把上面上传框里的csv文件以一个ID为文件名,上传到**/**文件夹下
2)读取这个文件夹下的csv的文件,转换成sql
3 ......

jsp链接sql2000的疑问?



type Exception report


message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jas ......

oracle 10g web登陆EM的问题? - Oracle / 基础和管理

安装了Oracle 10g,默认安装了orcl数据库,这个数据库能不能删除啊,还有我如果新建了其他数据库,怎么知道在web中登陆不同数据库的地址啊?

1
可以删除
2
在WEB地址栏中输入地址的时候指定新创建的数据库的IP ......

谁能推荐几本oracle的书或视频 - Oracle / 非技术区

谢谢
我也是想知道

me too

我 也 想 知 道 其 他 的,我 现 在 就 在 学 orcale 数 据 库,我 
用 的 是 赵 元 杰 编 的.......

个人觉得原理性的东西看一些官方文档可能会好一些 如果没有老师教 ......

oracle数据库 缓冲池 - Oracle / 基础和管理

请问这个缓冲池是怎么回事啊?可以连接缓冲池利用其中的数据吧?怎么用?
这个是oracle自动做的,一般应用程序是操作不了的。

不能直接连接吗?

引用
不能直接连接吗?
不能

那缓冲池里的数据也不能查询 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号