SELECT * FROM (SELECT events.idEvent,events.name_100,events.brief_100, events.content_100, events.active, events.link, events.video, events.duration,events.break,pictures.name as picture,releases.showStart, releases.showEnd, releases.customDateText, releases.promotion, releases.promoStart, releases.promoEnd, releases.promoInhome, releases.code,releases.code_102, releases.lowPrice, spaces.name as spaceName, spaces.code as SpaceCode, spaces.domain,spaces.streetAddress,spaces.addressRegion, releases.externalSpace FROM events INNER JOIN releases ON events.idEvent=releases.idEvent INNER JOIN pictures ON events.idEvent=pictures.idEvent INNER JOIN spaces ON releases.idSpace=spaces.idSpace WHERE events.active=1 AND releases.active=1 AND releases.idSpace=5 AND (releases.publishStart<=STR_TO_DATE('21/12/2024','%d/%m/%Y') AND releases.publishEnd>=STR_TO_DATE('21/12/2024','%d/%m/%Y')) GROUP BY events.idEvent,events.name_100,events.brief_100, events.content_100, events.active, events.link, events.video, events.duration,events.break,releases.showStart, releases.showEnd, releases.customDateText, releases.promotion, releases.promoStart, releases.promoEnd, releases.promoInhome, releases.code,releases.code_102, releases.lowPrice, spaceName, SpaceCode, spaces.domain,spaces.streetAddress,spaces.addressRegion, releases.externalSpace) AS table1 INNER JOIN (SELECT events.idEvent, releases.idRelease as idReleaseTVLC FROM events INNER JOIN releases ON events.idEvent=releases.idEvent INNER JOIN pictures ON events.idEvent=pictures.idEvent INNER JOIN spaces ON releases.idSpace=spaces.idSpace WHERE events.active=1 AND releases.active=1 AND releases.idSpace=1 AND (releases.publishStart<=STR_TO_DATE('21/12/2024','%d/%m/%Y') AND releases.publishEnd>=STR_TO_DATE('21/12/2024','%d/%m/%Y')) GROUP BY events.idEvent, idReleaseTVLC) AS table2 ON table1.idEvent=table2.idEvent ORDER BY table1.showStart
Busca la estrella para beneficiarte de promos especiales