select ads_regions.* from ads_regions left join paid_user_limited on ads_regions.uid = paid_user_limited.uid where 1=1 and (( moh like '%39%' and (hay='' or hay is null or hay=0) and (reg='' or reg is null or reg=0) ) or ( 1!=1 or ( hay like '%3915%' and (reg='' or reg is null or reg=0) )) or ( 1!=1 or reg like '%391511%' ) ) and (paid_user_limited.archive = 0) order by reg desc , hay desc