12311k

Untitled

Feb 28th, 2020
430
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. SELECT
  2. DISTINCT products.name AS name
  3. FROM
  4. (
  5. SELECT
  6. DISTINCT id_product
  7. FROM
  8. transactions
  9. WHERE
  10. id_store = 3
  11. ) AS subquery
  12. RIGHT JOIN products ON products.id_product = subquery.id_product
  13. WHERE
  14. subquery.id_product IS NULL
Advertisement
Add Comment
Please, Sign In to add comment