1
create table test(
2
abc TIMESTAMP,
3
abd date
4
)

2

3

4

1
INSERT INTO TEST(ABC)
2
VALUES(TO_TIMESTAMP('2008-08-08 14:15:23','YYYY-MM-DD HH24:MI:SS'));

2

1
Insert into test(abd)
2
values(to_date('2008-08-08 14:18:23','yyyy-mm-dd hh24:mi:ss'));

2

1
select
2
to_char(abc,'yyyy-mm-dd hh24:mi:ss'),
3
to_char(abd,'yyyy-mm-dd hh24:mi:ss')
4
from test;

2

3

4

4、條件查詢(xún)時(shí)間
1
select start_Date
2
from t_s_promote
3
where start_Date between to_date('2008-08-01','YYYY-MM-DD') and to_date('2008-09-01','YYYY-MM-DD');

2

3
