dzrs.net
当前位置:首页 >> orAClEBEtwEEn写法 >>

orAClEBEtwEEn写法

select * from 表名 where to_char(时间,'yyyymmddhh24miss') between '20100907000000' and '20100907235959'

oracle date等类型是带时间部分的,所以你这个2011-07-05 只是相当于2011-07-05 00:00:00这个时刻,按你的写法大于这个时刻的是不会删除的.如果你确实要删除2011-07-05的建议你用以下写法:delete from jf_syslog where inputtime >=date'

a between 1 and 10 等同与a>=1 and a

a between 1 and 10 等同与a>=1 and a<=10

between 是包含边界的,两边都包含.

select * from emp e where e.rownum between 3 and 9; 因为rownum 字段是你查询到数据后生成的字段

between and 是sql语句中条件之一,oracle也支持sql语句,pl/sql语句,在sql*plus中可以使用sql语句、pl/sql语句 sql*plus仅是oracle的一种开发数据的工具.

例子:select column_name from table_name where column_name between value1 and value2;

between and 和 >=,<=起的作用一样,性能差不多,看自己习惯问题选择用哪种方式.

oracle中between and包含边界值,也就是所谓的闭区间.如 between 1 and 100,则表示包含1和100及以内的一切数值.如以下语句:select name,score,case when score >= 90 then'优秀' when score between 70 and 89 then'良好' when score between 60 and 69 then'及格' when score < 60 then'不及格' end 等级 from test; 则代表:90分及以上为优秀,70分-89分为良好,60-69分为及格,60分以下为不及格.

网站首页 | 网站地图
All rights reserved Powered by www.dzrs.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com