I have seen both of these count() statements used in an oracle example and I was wondering what the difference?
Here is the exact query I was looking at:
SELECT s.prod_id, s.time_id,
COUNT(*) AS count_grp,
SUM(s.amount_sold) AS sum_dollar_sales,
COUNT(s.amount_sold) AS count_dollar_sales,
SUM(s.quantity_sold) AS sum_quantity_sales,
COUNT(s.quantity_sold) AS count_quantity_sales
FROM sales s
GROUP BY s.prod_id, s.time_id;
So what is the difference in COUNT(*) vs. COUNT(s.quantity_sold) as above?