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 30
| create multiset volatile table mvt_datas, no log
( Contrat varchar(10)
, Num_CDE varchar(10)
, Date_CTE timestamp(0)
, Telephone varchar(10)
, Date_Activation timestamp(0)
)
primary index (Contrat)
on commit preserve rows;
insert into mvt_datas values('1AZERTY', '5254366809', timestamp '2018-06-18 16:15:00', '771352815', timestamp '2018-06-21 14:22:00');
insert into mvt_datas values('1AZERTY', '5254366809', timestamp '2018-06-18 16:15:00', '771352817', timestamp '2018-06-21 14:22:00');
insert into mvt_datas values('1AZERTY', '5254366809', timestamp '2018-06-18 16:15:00', '771352819', timestamp '2018-06-21 14:24:00');
insert into mvt_datas values('1AZERTY', '6463642798', timestamp '2018-06-18 16:18:00', '771352815', timestamp '2018-06-21 14:22:00');
insert into mvt_datas values('1AZERTY', '6463642798', timestamp '2018-06-18 16:18:00', '771352817', timestamp '2018-06-21 14:22:00');
insert into mvt_datas values('1AZERTY', '6463642798', timestamp '2018-06-18 16:18:00', '771352819', timestamp '2018-06-21 14:24:00');
insert into mvt_datas values('1AZERTY', '8121887323', timestamp '2018-06-18 16:13:00', '771352815', timestamp '2018-06-21 14:22:00');
insert into mvt_datas values('1AZERTY', '8121887323', timestamp '2018-06-18 16:13:00', '771352817', timestamp '2018-06-21 14:22:00');
insert into mvt_datas values('1AZERTY', '8121887323', timestamp '2018-06-18 16:13:00', '771352819', timestamp '2018-06-21 14:24:00');
select Contrat, Num_CDE, Date_CTE, Telephone, Date_Activation
from mvt_datas
qualify row_number() over(partition by Contrat, Num_CDE order by Telephone asc)
= row_number() over(partition by Contrat, Telephone order by Num_CDE asc);
Contrat Num_CDE Date_CTE Telephone Date_Activation
------- ---------- ------------------- --------- -------------------
1AZERTY 5254366809 2018-06-18 16:15:00 771352815 2018-06-21 14:22:00
1AZERTY 6463642798 2018-06-18 16:18:00 771352817 2018-06-21 14:22:00
1AZERTY 8121887323 2018-06-18 16:13:00 771352819 2018-06-21 14:24:00 |
Partager