select a.*, b.providerid, b.productid, b.discount, b.price from saleprotocol a, product_salemode b where a.offer_orgid='3' and a.bid_orgid='*' and b.protocolid=a.id and b.providerid='8' and (b.productid='1' or b.productid = '*') and a.start_date <= '2023-06-29' and a.end_date > '2023-06-29' and a.del_flg = '0' and b.del_flg = '0' order by productid desc