SELECT DISTINCT(t1.oferta_id) as oferta_id, t1.alojamiento_id FROM ofertas as t1, ofertas_restricciones as t3, alojamientos as t2 WHERE (t2.member_id=1188 OR t1.alojamiento_id IN (SELECT alojamientos_id FROM administradores_alojamientos WHERE members_id=1188)) AND t1.alojamiento_id = t2.id AND t1.oferta_id=t3.oferta_id AND t3.f_fin>'2024-09-08' ORDER BY descuento DESC
SELECT DISTINCT(t1.oferta_id) as oferta_id, t1.alojamiento_id FROM ofertas as t1, ofertas_restricciones as t3 WHERE t1.alojamiento_id = 1689 AND t1.oferta_id=t3.oferta_id AND t3.f_fin>'2024-09-08' ORDER BY descuento DESC