Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Q4
--PostgreSQL 9.6 --'\\' is a delimiter CREATE TABLE spam (Name CHAR(20), Address CHAR(20), ID INTEGER, SameFam INTEGER); INSERT INTO spam(Name,Address,ID,SameFam) VALUES ('Alice','A',10,NULL), ('Bob','B',15,NULL), ('Carmen','C',22,NULL), ('Diego','A',9,10), ('Ella','B',3,15), ('Frankhad','D',11,NULL) ; CREATE TABLE table3 AS SELECT Name as name1,Address as Address1,ID as ID1,SameFam as SameFam1 From spam WHERE SameFam IS NULL; CREATE TABLE table4 AS SELECT Name as name2,Address,ID,SameFam From spam WHERE SameFam IS NOT NULL; SELECT * FROM spam EXCEPT SELECT name1,Address1,ID1,SameFam1 FROM table3 INNER JOIN table4 ON table3.id1 = table4.SameFam ORDER BY NAME;
run
|
edit
|
history
|
help
0
1
Demande complète
SQL Practice Sample: Movie Database
distinct on vs row_number
arjun
IF IN POSTGRESQL
a
Yandex Task
Select rows only with values separated by a given interval from other ...
PostgreSQL: CASE