Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
sss
select d.hour,s.in_time,s.out_time,count(s.id) over (partition by d.hour) c_ from (select 111 id,to_date('01/02/2017 15:26:00','dd/mm/yyyy hh24:mi:ss') in_time,to_date('01/02/2017 17:29:00','dd/mm/yyyy hh24:mi:ss') out_time from dual union select 222,to_date('01/02/2017 11:44:15','dd/mm/yyyy hh24:mi:ss'),to_date('01/02/2017 11:44:19','dd/mm/yyyy hh24:mi:ss') from dual union select 333,to_date('01/02/2017 11:47:42','dd/mm/yyyy hh24:mi:ss'),to_date('01/02/2017 12:41:33','dd/mm/yyyy hh24:mi:ss') from dual ) s right join (select to_date('01/02/2017 00:00:00','dd/mm/yyyy hh24:mi:ss')+ (level-1)/24 as hour from dual connect by level<25) d on d.hour=trunc(s.in_time,'HH') order by d.hour
run
|
edit
|
history
|
help
0
Srinivas
Addition of two numbers
Srinivas
nago
PL/SQL declaracionVariables
query
ABC
For loop
Sum of n numbers
exception handling