Skip to content

Instantly share code, notes, and snippets.

@Paulescu
Last active October 11, 2021 08:10
Show Gist options
  • Select an option

  • Save Paulescu/5d2ddc85106da901ae8373b40eb5b69a to your computer and use it in GitHub Desktop.

Select an option

Save Paulescu/5d2ddc85106da901ae8373b40eb5b69a to your computer and use it in GitHub Desktop.
hard.sql
-- SQL query you end up writing
WITH table1 AS (
SELECT ...
FROM ...
GROUP BY ...
)
,table2 AS (
SELECT ...
FROM ...
GROUP BY ...
)
,table3 AS (
SELECT ...
FROM ...
)
SELECT
feature1,
feature2,
...
featureN,
target
FROM
table1
INNER JOIN table2
LEFT JOIN table3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment