I think I have forgotten something.
I am querying several tables all with inner joins. if I use distinct, I get 16 rows returned.
If I don't, I get over 800.
if I add a few extra clauses to one of the inner joins, I get the correct resultset, without distinct and more quikcly than when using distinct.
But is it ok to have an inner join (or any join for that matter), relating to two or more tables.
Notice how the last two conditions relate to a different table from the first two.
join control_panel_data_business_sub_types as cpdbst
on cpdbst.business_type = btc.business_type
and cpdbst.sub_type = btc.sub_type
and cpdbst.cp_page_grouping = cpbd.cp_page_grouping
and cpdbst.page_category = cpbd.page_category