SELECT prod_type, SUM(flag = 0) AS ct
FROM products
WHERE prod_source = 'USA'
GROUP BY prod_type
ORDER BY prod_type;
| Subject | Views | Written By | Posted |
|---|---|---|---|
| GROUP BY SHOW ALL DISTINCT COLUMNS | 6075 | ajoe joseph | 08/16/2010 12:51AM |
| Re: GROUP BY SHOW ALL DISTINCT COLUMNS | 2190 | Chris Janton | 08/16/2010 04:03PM |
| Re: GROUP BY SHOW ALL DISTINCT COLUMNS | 2388 | Rick James | 08/16/2010 10:36PM |
| Re: GROUP BY SHOW ALL DISTINCT COLUMNS | 1719 | DBA Lead | 09/07/2010 06:18AM |
Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.