ALTER VIEW `vBluesealProductList` AS SELECT
                                       concat(`p`.`id`, '-', `pv`.`id`)         AS `codice`,
                                       `p`.`id`                                 AS `id`,
                                       `p`.`productVariantId`                   AS `productVariantId`,
                                       concat(`p`.`itemno`, ' # ', `pv`.`name`) AS `cpf`,
                                       `s`.`name`                               AS `shop`,
                                       `p`.`externalId`                         AS `externalId`,
                                       `pb`.`name`                              AS `brand`,
                                       `ps`.`name`                              AS `status`,
                                       `p`.`creationDate`                       AS `creationDate`,
                                       `s`.`id`                                 AS `shopId`,
                                       t.slug                 as tag,
                                       `pc`.`slug`                              AS `slug`,
                                       `dp`.`extId`                             AS `extId`,
                                       `ds`.`extSkuId`                          AS `extSkuId`
                                     FROM (((((((((((`Product` `p`
                                       JOIN `ProductVariant` `pv`)
                                       JOIN `ProductBrand` `pb`)
                                       JOIN `ProductStatus` `ps`)
                                       JOIN `ShopHasProduct` `sp`)
                                       JOIN `Shop` `s`)
                                       JOIN `ProductCategory` `pc`)
                                       JOIN `ProductHasProductCategory` `ppc`)
                                       LEFT JOIN ProductHasTag pht on p.id = pht.productId and p.productVariantId = pht.productVariantId )
                                       LEFT JOIN Tag t on pht.tagId = t.id)
                                       LEFT JOIN `DirtyProduct` `dp` ON (((`p`.`id` = `dp`.`productId`) AND (`p`.`productVariantId` = `dp`.`productVariantId`) AND
                                                                          (`sp`.`shopId` = `dp`.`shopId`))))
                                       LEFT JOIN `DirtySku` `ds` ON ((`dp`.`id` = `ds`.`dirtyProductId`)))

                                     WHERE ((`p`.`productVariantId` = `pv`.`id`) AND (`p`.`productBrandId` = `pb`.`id`) AND
                                            (((`p`.`id` = `sp`.`productId`) AND (`p`.`productVariantId` = `sp`.`productVariantId`)) OR
                                             (isnull(`sp`.`productId`) AND isnull(`sp`.`productVariantId`))) AND (`sp`.`shopId` = `s`.`id`) AND
                                            (`ps`.`id` = `p`.`productStatusId`) AND (`pc`.`id` = `ppc`.`productCategoryId`) AND
                                            (((`p`.`id` = `ppc`.`productId`) AND (`p`.`productVariantId` = `ppc`.`productVariantId`)) OR
                                             (isnull(`ppc`.`productId`) AND isnull(`ppc`.`productVariantId`))));
