SELECT
*
FROM
ads
WHERE
(
(
zobrazovat_do >= '2024-12-04'
and zobrazovat_od <= '2024-12-04'
)
or (zobrazovat_do is NULL or zobrazovat_do = '0000-00-00')
)
and id not in (1)
and aktivni = 1
and typ_reklamy = 'native-hashtag'
and lower(umisteni_podrobnosti) regexp '.*Op[tť][iíï] L[eéěë][nńň][šśs].*'
ORDER BY
priorita DESC,
RAND()
limit 1;
SELECT
*
FROM
ads
WHERE
(
(
zobrazovat_do >= '2024-12-04'
and zobrazovat_od <= '2024-12-04'
)
or (zobrazovat_do is NULL or zobrazovat_do = '0000-00-00')
)
and id not in (1)
and aktivni = 1
and typ_reklamy like '%eshop'
ORDER BY
priorita DESC,
RAND()
limit 1;