create view s_pars_product_5 as SELECT distinct category_id, product_id as prodId,name, sku as cod FROM pars_products; create view s_pars_oplata_5 as SELECT distinct action_id as careditId, name FROM pars_actions; CREATE OR REPLACE VIEW s_pars_oplata_group_5 AS SELECT DISTINCT (select MIN(po.id) from user1111058_sam.s_pars_oplata_5 po) AS min_oplata_id, p.product_id AS prod_product_id, p.price, group_concat(a.name SEPARATOR '|') as act_list FROM user1111058_oc_db.pars_actions a, user1111058_oc_db.pars_products p, user1111058_oc_db.pars_action_product ap WHERE a.id = ap.action_id AND p.id = ap.product_id GROUP BY p.product_id, p.price ORDER BY 2,1