An Error Was Encountered

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LEAD INNER JOIN izu_regions AS REGION ON LEAD.`actual_postcode` = REGION.`postal' at line 7

SELECT izu_category_counter.id,izu_category_counter.category,izu_category_counter.counter,itc.url_category_name FROM `izu_category_counter` inner join (SELECT TRIM(AC.category_c) as cat FROM `accounts` AS ACCOUNT INNER JOIN izu_regions AS REGION ON ACCOUNT.`actual_postcode` = REGION.`postalcode` INNER JOIN accounts_cstm AS AC ON AC.id_c=ACCOUNT.id WHERE ACCOUNT.`deleted` =0 and REGION.region IN ('Londonderry') UNION SELECT TRIM(LC.category_c) as cat FROM `leads` AS LEAD INNER JOIN izu_regions AS REGION ON LEAD.`actual_postcode` = REGION.`postalcode` INNER JOIN leads_cstm AS LC ON LC.id_c=LEAD.id WHERE LEAD.`deleted` =0 and LEAD.is_active=1 and REGION.region IN ('Londonderry')) as T1 ON T1.cat=izu_category_counter.category LEFT JOIN izu_temp_category AS itc ON itc.category_name = izu_category_counter.category where izu_category_counter.counter !=0 ORDER BY rand() limit 0,15