QUERY: select count(p.products_id) as count FROM (products p) INNER JOIN (products_to_categories p2c) ON (p.products_id = p2c.products_id)left join products_attributes pa ON pa.products_id = p.products_id left join products_options_values pov ON pov.products_options_values_id = pa.options_values_idleft join products_attributes pa ON pa.products_id = p.products_id left join products_options_values pov ON pov.products_options_values_id = pa.options_values_id WHERE p.products_status = 1 and p2c.categories_id = 78 and pa.attributes_stock > 0 and pov.products_options_values_name in ('S')and pa.attributes_stock > 0 and pov.products_options_values_name in ('XXL','XXXL','XXXXL','XXXXXL','50','52','Полуобхват 56 см','Полуобхват 60 см','Полуобхват 70 см','Полуобхват 75 см')
ERROR: Not unique table/alias: 'pa'