Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
このクエリを使用して、アクティビティの開始時刻と終了時刻の差の結果を取得しています。終了時間が null の場合、最小値を 500 に設定したいと考えていました。アドバイスとヘルプをお願いします!!
select * from table where (end_time - start_time) * 24 * 60 > 1, IF end_time IS NULL THEN '500';
start_time 列と end_time 列のデータ型は数値であると仮定しました。この計算では、すべて (*) ではなく、これらの特定の列を選択する必要があります。比較はwhere句で行われ、これはoracle11で機能します。
select ((NVL(END_TIME, 500)-START_TIME) * 24 * 60) from TABLE_NAME where ((NVL(END_TIME, 500)-START_TIME) * 24 * 60) > 1;