Last active
April 3, 2020 20:09
-
-
Save tolyod/693e96d7f7fa8d45b91ff55cce65deae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT p.id, | |
p.items, | |
Ifnull(Sum(s.stock), 0) AS sumstock | |
FROM phpshop_products p | |
left JOIN | |
( | |
select warehouse_id, | |
enabled, | |
product_id, | |
stock | |
from phpshop_modules_warehouse_stocks | |
where warehouse_id IN ( 0 ) | |
AND enabled = '1' | |
) s | |
ON p.id = s.product_id | |
WHERE p.id IN ( 1288, 863 ) | |
group by p.id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment