我的oracle表中有数据,我的名字和日期范围如下:
Name From To Lopes,Janine 07-Jun-17 16-Jul-17 Lopes,Janine 17-Jul-17 23-Jul-17 Lopes,Janine 24-Jul-17 31-Aug-17 Baptista,Maria 23-Dec-16 19-Feb-17 Deyak,Sr,Thomas 22-Jan-17 18-Apr-17 Deyak,Thomas 27-Apr-17 14-May-17 Deyak,Thomas 15-May-17 21-May-17 Deyak,Thomas 22-May-17 28-May-17 Deyak,Thomas 29-May-17 31-May-17 Serrentino,Joyce 18-Mar-17 30-Apr-17 More,Cathleen 30-Jul-17 13-Aug-17 More,Cathleen 14-Aug-17 20-Aug-17 More,Cathleen 21-Aug-17 27-Aug-17 More,Cathleen 28-Aug-17 03-Sep-17 More,Cathleen 04-Sep-17 10-Sep-17 More,Cathleen 11-Sep-17 24-Sep-17 Barrows,Michael 30-Jan-17 19-Mar-17 Barrows,Michael 20-Mar-17 26-Mar-17 Barrows,Michael 27-Mar-17 02-Apr-17 Barrows,Michael 03-Apr-17 07-Apr-17
主要是对于一个用户来说,日期比起日期大一个并且是连续的,但在某些情况下会破坏数据,所以我的输出应该如下所示:
Name From To Lopes,Janine 07-Jun-17 31-Aug-17 Baptista,Thomas 27-Apr-17 31-May-17 Serrentino,Cathleen 30-Jul-17 24-Sep-17 Barrows,Michael 30-Jan-17 07-Apr-17