You are on page 1of 1

-------------------------------- group by premises type without rsv and vehicle SELECT pt.

p_type, count( * ) FROM `premises` p, premises_type pt, area a, town t, premises_category pc WHERE p.p_premisestype = pt.p_type_id AND p.p_area_id = a.a_id AND a.t_id = t.t_id AND p.p_premises_cat = pc.cat_id AND t.t_id = 2 AND p.p_premises_cat NOT IN ( 3, 6 ) AND p.islicensable <> "D" GROUP BY pt.p_type ------------------------------- group by premises category SELECT pc.cat_desc, count( * ) FROM `premises` p, premises_type pt, area a, town t, premises_category pc WHERE p.p_premisestype = pt.p_type_id AND p.p_area_id = a.a_id AND p.p_premises_cat = pc.cat_id AND a.t_id = t.t_id AND t.t_id = 5 AND p.islicensable <> "D" GROUP BY pc.cat_desc

You might also like