SQL:SELECT pp.id,pp.extra_type, p.* FROM products_price as pp INNER JOIN products as p ON pp.prod_id=p.id WHERE pp.extra_to_prod = '0' or