select * from popups where idSpace=2 and (active=1 or authorized_ips like '%18.97.14.86%') and (id in (select idPopup from popups_pages where url like '/?gclid=Cj0KCQiAk4aOBhCTARIsAFWFP9HDVvp5FxFTRdn2qGniaxFT7LepY6PbqVm4AkwOjFvfwsypG6ZJYSkaAnfYEALw_wcB' and active=1) or id not in (select idPopup from popups_pages where active=1))
18.97.14.86



















































