clear markdown feedback
clear markdown feedback
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 3364508 fiddles created (36285 in the last week).

CREATE TABLE tableA (name VARCHAR(10), reportDay DATE, val1 INTEGER, val2 INTEGER); CREATE TABLE tableB (name VARCHAR(10), reportDay DATE, test1 INTEGER, test2 INTEGER); INSERT INTO tableA values ('A','2022-Apr-05',1,2), ('B','2022-Apr-05',3,4), ('C','2022-Apr-05',5,6), ('Z','2022-Apr-06',5,6), ('A','2022-Apr-06',1,2), ('B','2022-Apr-06',3,4), ('C','2022-Apr-06',5,6); INSERT INTO tableB values ('B','2022-Apr-05',11,22), ('C','2022-Apr-05',33,44), ('D','2022-Apr-05',55,66), ('Q','2022-Apr-06',5,6), ('B','2022-Apr-06',11,22), ('C','2022-Apr-06',33,44), ('D','2022-Apr-06',55,66);
7 rows affected
7 rows affected
 hidden batch(es)


SELECT a.*, b.* FROM tableA a FULL OUTER JOIN tableB b ON b.name = a.name AND a.reportDay = b.reportDay WHERE '2022-Apr-05' IN (a.reportDay, b.reportDay);
name reportday val1 val2 name reportday test1 test2
A 2022-04-05 1 2
B 2022-04-05 3 4 B 2022-04-05 11 22
C 2022-04-05 5 6 C 2022-04-05 33 44
D 2022-04-05 55 66
 hidden batch(es)


SELECT a.*, b.* FROM tableA a FULL OUTER JOIN tableB b ON b.name = a.name WHERE (a.reportDay = '2022-Apr-05' OR a.reportDay IS NULL) AND (b.reportDay = '2022-Apr-05' OR b.reportDay IS NULL);
name reportday val1 val2 name reportday test1 test2
A 2022-04-05 1 2
B 2022-04-05 3 4 B 2022-04-05 11 22
C 2022-04-05 5 6 C 2022-04-05 33 44
D 2022-04-05 55 66
 hidden batch(es)