Copy this code and paste it in your HTML
SELECT derived.usersid
, derived.product_id
, count( derived.user_id
) AS viewcount
, SUM( IF( age
<20, 1, 0 ) ) AS 'Under 20', SUM( IF( age
AND 79 , 1, 0 ) ) AS '70 - 79', SUM( IF( age
>=80, 1, 0 ) ) AS 'Over 80', SUM( IF( age
IS NULL , 1, 0 ) ) AS 'Not Filled In (NULL)'
SELECT iu.usersid
, ipv.product_id
, ipv.user_id
, count( ( ipv.user_id