Oracle中关于时间的to_char和to_date
2013-08-12 21:40
423 查看
to_char()将时间值转换为字符串,to_date()将字符串转换为时间
select customer_id,first_name||''||last_name,dob from customers where to_char(dob,'mm')='07';
select customer_id,first_name||''||last_name,dob from customers where to_char(dob,'yyyy')='1958';
select customer_id,first_name||''||last_name,dob from customers where to_char(dob,'yyyy-mm')='1958-04';
select customer_id,first_name||''||last_name,dob from customers where to_char(dob,'yyyy-mm-dd')='1958-04-13';
select customer_id,first_name||''||last_name,dob from customers where to_char(dob,'yyyy-mm-dd')>'1958-04-13';
select customer_id,first_name||''||last_name,dob from customers where dob=to_date('1958-4月-13','yyyy-month-dd');
select customer_id,first_name||''||last_name,dob from customers where dob>to_date('1958-4月-13','yyyy-month-dd');
select customer_id,first_name||''||last_name,dob from customers where dob>to_date('1958-4月','yyyy-month');
select customer_id,first_name||''||last_name,dob from customers where to_char(dob,'mm')='07';
select customer_id,first_name||''||last_name,dob from customers where to_char(dob,'yyyy')='1958';
select customer_id,first_name||''||last_name,dob from customers where to_char(dob,'yyyy-mm')='1958-04';
select customer_id,first_name||''||last_name,dob from customers where to_char(dob,'yyyy-mm-dd')='1958-04-13';
select customer_id,first_name||''||last_name,dob from customers where to_char(dob,'yyyy-mm-dd')>'1958-04-13';
select customer_id,first_name||''||last_name,dob from customers where dob=to_date('1958-4月-13','yyyy-month-dd');
select customer_id,first_name||''||last_name,dob from customers where dob>to_date('1958-4月-13','yyyy-month-dd');
select customer_id,first_name||''||last_name,dob from customers where dob>to_date('1958-4月','yyyy-month');
相关文章推荐
- 关于oracle多语言环境下to_date时间转换问题
- oracle中关于日期的to_char和to_date
- 关于Oracle to_date() 与 to_char() 日期和字符串转换及IW,WW 周别显示
- Oracle的日期时间 to_date和to_char
- Oracle中的时间函数用法(to_date、to_char)
- oracle 按时间查询(to_date(),to_char()的巧用)
- Oracle中时间格式在TO_DATE与TO_CHAR中的应用
- Oracle中的时间函数用法(to_date、to_char) (总结)
- Oracle中的时间函数用法(to_date、to_char)
- oracle中对时间的操作以及to_char和to_date用法总结
- Oracle中的时间函数用法(to_date、to_char) (总结)
- Oracle中时间日期转化函数to_date和to_char用法总结
- Oracle时间运算 to_char() sysdate
- Oracle的日期时间 to_date和to_char
- Oracle中的时间函数用法(to_date、to_char) (总结)
- Oracle中的时间函数用法(to_date、to_char) (总结)
- Oracle中的时间函数用法(to_date、to_char)
- 在数据库中(Oracle),根据时间查询数据: to_date()和to_char()函数
- Oracle中的时间函数用法(to_date、to_char) (总结)
- oracle里面的时间转字符串to_char(),字符串转时间to_date(),以及substr和instr的使用。