Query / Запрос |
select c.id,c.location_id location,c.banner_id,c.only_moscow,b.name,b.target,b.url,b.text,b.image1,b.image2,b.w,b.h from ad_camp c,ad_banners b
where c.banner_id=b.id and c.inwork='1' and c.pause='0' and c.datestart<1759542269
and (c.allpages=1 or c.treeurl like '%,207,%')
and c.extreeurl not like '%,207,%'
and c.timemin<=4 and c.timemax>=4
and c.daysview like '%,6,%'
order by rand() |