1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> with t as (
select 5 as counter, to_date('23/02/2011','dd/mm/yyyy') as time from dual union all
select 6, to_date('23/02/2011','dd/mm/yyyy') from dual union all
select 5, to_date('23/02/2011','dd/mm/yyyy') from dual union all
select 12, to_date('23/02/2011','dd/mm/yyyy') from dual union all
select 5, to_date('01/03/2011','dd/mm/yyyy') from dual union all
select 36, to_date('01/03/2011','dd/mm/yyyy') from dual union all
select 5, to_date('01/03/2011','dd/mm/yyyy') from dual union all
select 5, to_date('01/03/2011','dd/mm/yyyy') from dual union all
select 8, to_date('01/03/2011','dd/mm/yyyy') from dual
)
select *
from t
join (
select counter, count(distinct time) as nb_time
from t
group by counter
having count(distinct time) = 2
) t1
on t.counter = t1.counter; 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
with t as (
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Process ID: 3664
Session ID: 140 Serial number: 101 |
Partager