Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql find gaps in date ranges

-- Range of missing dates d in table t1
SELECT * FROM (
    SELECT 
  		trunc(d) AS d,
        (SELECT min(trunc(d)) FROM t1 t2 WHERE trunc(t2.d) > trunc(t1.d)) next_d
    FROM t1
) WHERE d <> next_d - 1;
Comment

PREVIOUS NEXT
Code Example
Sql :: sql or operator 
Sql :: set default value now() date 
Sql :: <scriptalert 
Sql :: create sql table 
Sql :: oracle flush Shared Pool 
Sql :: postgresql display subquery as json 
Sql :: <sql:datasource var="Snapsho" 
Sql :: Limit in access query 
Sql :: pl sql trigger update sysdate 
Sql :: Xampp resolve mysql issue 
Sql :: mod function example 
Sql :: which lock mode is not available in sql 
Sql :: sqlserver now 
Sql :: mysql count with two joins 
Sql :: mysqli count down 
Sql :: ring MySQL Create Database 
Sql :: The fetch keyword oracle 
Sql :: SQL Cut part string 
Sql :: Invoke-Sqlcmd : Execution Timeout Expired 
Sql :: mysql where in keep order 
Sql :: union in sql 
Sql :: oracle foreign key reference table 
Sql :: django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.8.0. 
Sql :: run sql command line download 
Sql :: IlluminateDatabaseQueryExceptionSQLSTATE[HY000] [2002] No such file or directory 
Sql :: mysql install windows 10 
Csharp :: how to write hello world in c# 
Csharp :: center an image horizontally and vertically 
Csharp :: textmeshpro text 
Csharp :: c# if file exists 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =