Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save eliank/432b76218a34fc3c94c50f12edfffe4f to your computer and use it in GitHub Desktop.
Save eliank/432b76218a34fc3c94c50f12edfffe4f to your computer and use it in GitHub Desktop.
some_table_some_index_query AS (
 SELECT “some_table”.”id” FROM “some_table” WHERE (some_variable IN (‘some_value’, ‘another_value’, ‘yet_another_value’) AND ((some_date <= ‘2016–05–01’ AND DATE_TRUNC(‘day’, updated_at) <= some_date)
)
SELECT * FROM “some_table_some_index_query” WHERE (“some_table”.”id” > 123456789) ORDER BY “id” ASC LIMIT 1000;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment