Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql period overlap

-- table1          <-----row 1 interval------->
-- table2  <---find this--> <--and this--> <--and this-->

SELECT * 
FROM table1,table2 
WHERE table2.start <= table1.end 
AND (table2.end IS NULL OR table2.end >= table1.start)
Comment

PREVIOUS NEXT
Code Example
Sql :: how to remove unique key in mysql 
Sql :: postgresql parse json array 
Sql :: set all auto_increment values in sql 
Sql :: sql sum show 0 result 
Sql :: sql database connectivity 
Sql :: oracle alter table add column default value 
Sql :: mysql create table from select statement 
Sql :: oracle nvl 
Sql :: change column data type sql 
Sql :: check if value is null mysql 
Sql :: select random sample sql 
Sql :: sum value by month sql 
Sql :: install latest mysql 8 linux server 
Sql :: Syntax error or access violation: 1701 Cannot truncate a table referenced in a foreign key constraint 
Sql :: get initial in sql 
Sql :: sql query to select data between two dates 
Sql :: mysql add to value 
Sql :: sql sequence 
Sql :: create table mysql integer NOT null 
Sql :: postgresql in array 
Sql :: oracle sql sort ascending 
Sql :: for select oracle 
Sql :: pl sql search in all packages 
Sql :: truncate your answer to decimal places mysql 
Sql :: mysql create table index 
Sql :: postgres parent and child tables 
Sql :: how to check which sp is running in sql server 
Sql :: delete table row in postgresql 
Sql :: Select with remove white spaces in sql 
Sql :: sql dcl 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =