Skip to content

Instantly share code, notes, and snippets.

@montanalow
Created February 4, 2021 00:31
Show Gist options
  • Save montanalow/44444080b2e444879edbf3a26ae3bf0e to your computer and use it in GitHub Desktop.
Save montanalow/44444080b2e444879edbf3a26ae3bf0e to your computer and use it in GitHub Desktop.
SELECT *
FROM products
NATURAL JOIN items
WHERE products.keywords @@ to_tsquery('apple') -- full text query
AND items.retailer_location_id = 123 -- a single store's inventory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment