select p.products_id, p.products_model, p.products_image, p.products_image_lrg, if (isnull(pg.customers_group_price), p.products_price, pg.customers_group_price) as final_price, p.products_tax_class_id, pd.products_name from (products p left join products_groups pg on p.products_id = pg.products_id and pg.customers_group_id = 'G'), products_description pd where p.products_id = '965' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_group_access like '%G%'