SELECT DISTINCTproducts.name AS nameFROMproductsLEFT JOIN (SELECTid_productFROMtransactionsWHERECAST(transactions.date AS date) = '2019-06-01') AS SUBQ1 ON products.id_product = SUBQ1.id_productWHERESUBQ1.id_product IS NOT NULLUNIONSELECT DISTINCTproducts.name AS nameFROMproductsLEFT JOIN (SELECTid_productFROMtransactionsWHERECAST(transactions.date AS date) = '2019-06-08') AS SUBQ2 ON products.id_product = SUBQ2.id_productWHERESUBQ2.id_product IS NOT NULL;