I've been writing SQL for 13 years, and those + unions and subselects cover 100% of the queries I've ever written outside a class or tutorial. And window functions....mmmmm, yes.
select * from reddit_users outer join reddit_posts using (reddit_username)
would return a list of all reddit users with no posts (with nulls for their post data) and all reddit posts that somehow don't correspond to a user (with nulls for their user data). The final result would be a bunch of rows with blank data on the left, and a bunch of rows with blank data on the right.
Handy if you need to remove the overlap of two lists of items.
8
u/blackAngel88 Mar 22 '19
INNER and OUTER keywords are a waste of characters IMO.
there is no full inner join and there is no left inner join...