SELECT
*
FROM
ads
WHERE
(
(
zobrazovat_do >= '2024-12-05'
and zobrazovat_od <= '2024-12-05'
)
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 '.*V[eéěë][tť][eéěë][rřŕ][iíï][nńň][aáä] P[óoö][šśs][tť][óoö][lľĺ][óoö]p[rřŕ][tť][yýÿ].*'
ORDER BY
priorita DESC,
RAND()
limit 1;
SELECT
*
FROM
ads
WHERE
(
(
zobrazovat_do >= '2024-12-05'
and zobrazovat_od <= '2024-12-05'
)
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;