如题,另外还有个小问题:
select to_char(sysdate,'yyyy-mm-dd') ,sysdate from dual;
结果: 2009-07-27 27-JUL-09
想问一下,这里只有日期,那么时分秒哪去了呢?如何显示呢?
谢谢大侠啦
select to_char(sysdate,'yyyy-mm-dd') ,sysdate from dual;
结果: 2009-07-27 27-JUL-09
想问一下,这里只有日期,那么时分秒哪去了呢?如何显示呢?
谢谢大侠啦
select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;
2009-07-27 09:59:15
--to_date
select to_date('2009-07-27','yyyy-mm-dd') from dual;
--to_char
select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;
to_char(sysdate,'yyyy-mm-dd hh24:mi:ss')在google上一查:http://hi.baidu.com/djx_5211314/blog/item/4fec8713905df5826438db47.html很多资料
sysdate默认是只显示 年月日的,
select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;可以以字符串的形式显示出 年月日以及时间SQL> select systimestamp from dual;SYSTIMESTAMP
------------------------------------------
27-7月 -09 11.38.18.699000 上午 +08:00
==================
错误
那是因为to_char的格式造成的
to_char和to_date的用法,是基本函数用法,自己去搜索下就能找到答案,要学会自己去学习
楼上各位都是to_char()后得到这样的结果,那请问有这样的 日期类型么:年月日小时分秒 这样的格式的。
timestamp类型SYSTIMESTAMP
----------------------------------------
27-7月 -09 05.20.30.812000 下午 +08:00