Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
quiz 1
--PostgreSQL 9.6 --'\\' is a delimiter create table orders ( orderid int, item varchar(20)); insert into orders values ( 1, 'Fries' ), ( 1, 'Soda' ), ( 1, 'Burger'), ( 2, 'Fries' ), ( 2, 'Soda' ), ( 3, 'Burger'), ( 3, 'Fries' ), ( 4, 'Soda' ), ( 4, 'Burger'), ( 5, 'Fries' ), ( 5, 'Soda' ), ( 6, 'Burger'), ( 6, 'Popcorn'), ( 6, 'Soda' ), ( 6, 'Fries' ), ( 7, 'Fries' ), ( 7, 'Soda' ), ( 7, 'Burger'); /********* item item count 1 Fries Soda 5 2 Burger Fries 4 3 Burger Soda 4 4 Fries Popcorn 1 5 Popcorn Soda 1 6 Burger Popcorn 1 ********/ select o1.item, o2.item, count(*) from orders o1 join orders o2 on o1.orderid = o2.orderid and o1.item <> o2.item and o1.item < o2.item group by o1.item, o2.item order by count(*) desc
run
|
edit
|
history
|
help
0
postgresql select test
1258. Find the Start and End Number of Continuous Ranges
Ass2 q2
Food Delivery Website SQL Analysis
How i can get the difference of closest two date in two table join in postgresql
Assignment
75 95
Movie Rating SQL Analysis Project
Conditional Cross Join - Why doesn't this work on the 'ON' clause?
Full text search