Skip to content

Instantly share code, notes, and snippets.

@Mr--John-Doe
Created October 29, 2021 08:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mr--John-Doe/b6bfe445dc1742c540db2267b25f8a42 to your computer and use it in GitHub Desktop.
Save Mr--John-Doe/b6bfe445dc1742c540db2267b25f8a42 to your computer and use it in GitHub Desktop.
SELECT sales.id
, coalesce(client.someColumn, store.someColumn2) someColumn
, client.someOtherColumn
, store.oneOther
, store.andThenSome
, store.plusThisONe
FROM this_important_table as sales
LEFT JOIN other_table as client
on sales.id = client._id
INNER JOIN some_other_table as store
on sales.id = store.super_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment