Created
June 11, 2019 04:21
-
-
Save CristianRP/6077a1953ca8ca108f13fdbdb3536d04 to your computer and use it in GitHub Desktop.
Revisions
-
CristianRP created this gist
Jun 11, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ SELECT P.ID, P.NAME, COUNT(OD.ID) FORESTACION FROM PRODUCTS P, ORDER_DETAILS OD WHERE P.ID = OD.PRODUCT_ID GROUP BY P.ID, P.NAME SELECT C.NAME, COUNT(P.ID) FORESTACION FROM CATEGORIES C INNER JOIN PRODUCTS P ON C.ID = P.CATEGORY_ID INNER JOIN ORDER_DETAILS OD ON OD.PRODUCT_ID = P.ID GROUP BY C.NAME