CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_product_display_price` AS select `p`.`id` AS `product_id`,`p`.`sku` AS `sku`,`p`.`name` AS `name`,round((`cpp`.`cost_price` * (1 + (`cpp`.`markup_pct` / 100))),2) AS `price_ex_vat`,round(((`cpp`.`cost_price` * (1 + (`cpp`.`markup_pct` / 100))) * 1.15),2) AS `price_inc_vat`,`cpp`.`cost_price` AS `cost_price`,`cpp`.`markup_pct` AS `markup_pct`,`cpp`.`currency_code` AS `currency_code`,`cpp`.`min_qty` AS `min_qty` from (`catalog_products` `p` left join `catalog_product_prices` `cpp` on(((`cpp`.`product_id` = `p`.`id`) and (`cpp`.`is_active` = 1) and (`cpp`.`min_qty` = 1)))) where (`p`.`status` = 'active') group by `p`.`id`