One of the Oracle-SQL skills (query continuous records) Requirement Description: www.2cto.com needs to query that a customer has been continuously performing business for those days of a year. The SQL implementation is as follows: Create a table: create table test_num (tyear number, tdate date); www.2cto.com test data: insert into test_numselect 2014, trunc (sysdate)-1 from dual union all select 2014, trunc (sysdate) -002 from dual union all select 2014, trunc (sysdate)-003 from dual union all select 2014, trunc (sysdate)-004 from dual union all select 2014, trunc (sysdate) -005 from dual union all select 2014, trunc (sysdate)-007 from dual union all select 2014, trunc (sysdate)-008 from dual union all select 2014, trunc (sysdate) -2013 from dual union all select 120, trunc (sysdate)-2013 from dual union all select 121, trunc (sysdate)-2013 from dual union all select, trunc (sysdate) -122 from dual union all select 2013, trunc (sysdate)-124 from dual union all select 2013, trunc (sysdate)-125 from dual union all select 2013, trunc (sysdate) -127 from dual union all select 2015, trunc (sysdate)-099 from dual union all select 2015, trunc (sysdate)-100 from dual union all select 2015, trunc (sysdate) -101 from dual union all select 2015, trunc (sysdate)-102 from dual union all select 2015, trunc (sysdate)-104 from dual union all select 2015, trunc (sysdate) -105 from dual; write SQL: SELECT TYEAR, MIN (TDATE) AS STARTDATE, MAX (TDATE), COUNT (TYEAR) AS ENDNUM FROM (SELECT. *,. TDATE-rownum as gnum from (SELECT * FROM TEST_NUM order by tyear, TDATE) A) group by tyear, gnum order by tyear, MIN (TDATE)