Skip to content

Instantly share code, notes, and snippets.

@half2me
Created December 30, 2015 19:57
Show Gist options
  • Save half2me/eca68fe9535dc0238ac0 to your computer and use it in GitHub Desktop.
Save half2me/eca68fe9535dc0238ac0 to your computer and use it in GitHub Desktop.
$query in SQL code
SELECT
Products.id AS `Products__id`
FROM
products Products
INNER JOIN websites Websites ON Websites.id = 1
INNER JOIN products_websites ProductsWebsites ON (
Products.id = (ProductsWebsites.product_id)
AND Websites.id = (ProductsWebsites.website_id)
)
INNER JOIN product_info ProductInfo ON (
ProductInfo.sku = '307793-002'
AND ProductInfo.id = (Products.product_info_id)
)
WHERE
(
(reservation_id) IS NULL
AND size = '4.5Y'
)
LIMIT
3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment