1

以下のサンプル出力を含むテーブルが oracle にあります。

EID   | type  |   Date
24    |  IN   |03/25/2019 6:45 am
24    |  OUT  |03/25/2019 8:05 am
24    |  IN   |03/25/2019 8:06 am
24    |  IN   |03/25/2019 8:28 am
24    |  OUT  |03/25/2019 9:48 am
24    |  IN   |03/25/2019 9:52 am
24    |  IN   |03/25/2019 9:57 am
24    |  IN   |03/25/2019 10:44 am
24    |  OUT  |03/25/2019 12:16 pm
24    |  OUT  |03/25/2019 1:00 pm
24    |  IN   |03/25/2019 1:05 pm
24    |  OUT  |03/25/2019 2:21  pm

以下の結果を達成するためのクエリを作成したいと思います。

EID |       TIMEIN        |    TIMEOUT            | DIIF_IN_MIN 
24  | 03/25/2019 6:45 am  | 03/25/2019 8:05 am    |   1 
24  | 03/25/2019 8:06 am  |       null            |   0
24  | 03/25/2019 8:28 am  | 03/25/2019 9:48 am    |   4
24  | 03/25/2019 9:52 am  |       null            |   0
24  | 03/25/2019 9:57 am  |       null            |   0
24  | 03/25/2019 10:44 am | 03/25/2019 12:16 pm   |   0
24  |        null         | 03/25/2019 1:00 pm    |   5
24  | 03/25/2019 1:05 pm  | 03/25/2019 2:21  pm   |   0
4

2 に答える 2