Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Final test
--PostgreSQL 9.6 --'\\' is a delimiter CREATE SCHEMA erp; CREATE TABLE erp.orders( id integer PRIMARY KEY, userId integer, paidAt timestamp DEFAULT current_timestamp ); CREATE SCHEMA prod; CREATE TABLE prod.referral_order_delivered( user_id integer ); INSERT INTO erp.orders VALUES ('374893429','1','2017-06-30' ), ('23718932','1','2017-06-18' ), ('23892031','2','2017-06-07' ), ('283238321','4','2017-06-07' ), ('8323218','3','2017-01-01' ), ('2819','2','2017-01-01' ), ('2383','2','2017-01-01' ), ('21839','2','2017-01-01' ) ; INSERT INTO prod.referral_order_delivered VALUES ('1' ), ('2'), ('1' ), ('1' ), ('1' ) ; --PUT YOUR REQUEST HERE
run
|
edit
|
history
|
help
0
array comparison
1225. Report Contiguous Dates
Movie Rating SQL Analysis Project
asd
Limit & union
Return IDs where there are exactly 3 occurrences
cpana
Select rows with no intersection on join table and check by date
arjun
Return IDs where there are exactly 3 occurrences1