LoginSignup
9
12

More than 5 years have passed since last update.

Oracleで日付型データを検索する場合の指定方法

Last updated at Posted at 2016-04-23

はじめに

Oracleで日付型(DATE型)データを検索する場合の指定方法を以下記載します。

表記法

where begin_time >= to_date('2016/04/23 00:00:00', 'yyyy/mm/dd hh24:mi:ss')
and begin_time <= to_date('2016/04/23 23:59:59', 'yyyy/mm/dd hh24:mi:ss');

実行例

SQL> select begin_time, end_time, undotsn from dba_hist_undostat
  2  where begin_time >= to_date('2016/04/23 00:00:00', 'yyyy/mm/dd hh24:mi:ss')
  3  and begin_time <= to_date('2016/04/23 23:59:59', 'yyyy/mm/dd hh24:mi:ss');

BEGIN_TIME          END_TIME               UNDOTSN
------------------- ------------------- ----------
2016-04-23 09:19:38 2016-04-23 09:29:38          2
9
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
12