SELECT (Count(*)) As Expr1 FROM (koul8_contentAS c) INNERJOINkoul8_contentAS ar ON c.parentid=ar.id WHERE ((c.catid=34) AND (c.access IN (1,1)) AND (ar.access IN (1,1)) AND c.parentid=13445 AND ar.state = 1 AND c.state = 1)

SELECT (Count(*)) As Expr1 FROM (koul8_contentAS c) INNERJOINkoul8_contentAS ar ON c.parentid=ar.id WHERE ((c.catid=34) AND (c.access IN (1,1)) AND (ar.access IN (1,1)) AND c.parentid=13444 AND ar.state = 1 AND c.state = 1)

SELECT (Count(*)) As Expr1 FROM (koul8_contentAS c) INNERJOINkoul8_contentAS ar ON c.parentid=ar.id WHERE ((c.catid=34) AND (c.access IN (1,1)) AND (ar.access IN (1,1)) AND c.parentid=13443 AND ar.state = 1 AND c.state = 1)

SELECT (Count(*)) As Expr1 FROM (koul8_contentAS c) INNERJOINkoul8_contentAS ar ON c.parentid=ar.id WHERE ((c.catid=34) AND (c.access IN (1,1)) AND (ar.access IN (1,1)) AND c.parentid=13442 AND ar.state = 1 AND c.state = 1)

SELECT (Count(*)) As Expr1 FROM (koul8_contentAS c) INNERJOINkoul8_contentAS ar ON c.parentid=ar.id WHERE ((c.catid=34) AND (c.access IN (1,1)) AND (ar.access IN (1,1)) AND c.parentid=13440 AND ar.state = 1 AND c.state = 1)

SELECT (Count(*)) As Expr1 FROM (koul8_contentAS c) INNERJOINkoul8_contentAS ar ON c.parentid=ar.id WHERE ((c.catid=34) AND (c.access IN (1,1)) AND (ar.access IN (1,1)) AND c.parentid=13439 AND ar.state = 1 AND c.state = 1)

SELECT (Count(*)) As Expr1 FROM (koul8_contentAS c) INNERJOINkoul8_contentAS ar ON c.parentid=ar.id WHERE ((c.catid=34) AND (c.access IN (1,1)) AND (ar.access IN (1,1)) AND c.parentid=13438 AND ar.state = 1 AND c.state = 1)

SELECT (Count(*)) As Expr1 FROM (koul8_contentAS c) INNERJOINkoul8_contentAS ar ON c.parentid=ar.id WHERE ((c.catid=34) AND (c.access IN (1,1)) AND (ar.access IN (1,1)) AND c.parentid=13437 AND ar.state = 1 AND c.state = 1)

SELECT (Count(*)) As Expr1 FROM (koul8_contentAS c) INNERJOINkoul8_contentAS ar ON c.parentid=ar.id WHERE ((c.catid=34) AND (c.access IN (1,1)) AND (ar.access IN (1,1)) AND c.parentid=13436 AND ar.state = 1 AND c.state = 1)

SELECT (Count(*)) As Expr1 FROM (koul8_contentAS c) INNERJOINkoul8_contentAS ar ON c.parentid=ar.id WHERE ((c.catid=34) AND (c.access IN (1,1)) AND (ar.access IN (1,1)) AND c.parentid=13435 AND ar.state = 1 AND c.state = 1)

SELECT (Count(*)) As Expr1 FROM (koul8_contentAS c) INNERJOINkoul8_contentAS ar ON c.parentid=ar.id WHERE ((c.catid=34) AND (c.access IN (1,1)) AND (ar.access IN (1,1)) AND c.parentid=13434 AND ar.state = 1 AND c.state = 1)

SELECT a.id as id,a.type as type,a.name as name,a.clickurl as clickurl,a.cid as cid,a.params as params,a.custombannercode as custombannercode,a.track_impressions as track_impressions,cl.track_impressions as client_track_impressions
FROMkoul8_banners as a
LEFTJOINkoul8_banner_clientsAS cl ON cl.id = a.cid
WHERE a.state=1 AND (CURRENT_TIMESTAMP() >= a.publish_up OR a.publish_up = '0000-00-00 00:00:00') AND (CURRENT_TIMESTAMP() <= a.publish_down OR a.publish_down = '0000-00-00 00:00:00') AND (a.imptotal = 0 OR a.impmade <= a.imptotal) AND a.catid IN (13)
ORDERBY a.sticky DESC,a.ordering

SELECT a.id as id,a.type as type,a.name as name,a.clickurl as clickurl,a.cid as cid,a.params as params,a.custombannercode as custombannercode,a.track_impressions as track_impressions,cl.track_impressions as client_track_impressions
FROMkoul8_banners as a
LEFTJOINkoul8_banner_clientsAS cl ON cl.id = a.cid
WHERE a.state=1 AND (CURRENT_TIMESTAMP() >= a.publish_up OR a.publish_up = '0000-00-00 00:00:00') AND (CURRENT_TIMESTAMP() <= a.publish_down OR a.publish_down = '0000-00-00 00:00:00') AND (a.imptotal = 0 OR a.impmade <= a.imptotal) AND a.catid IN (13)
ORDERBY a.sticky DESC,a.ordering LIMIT 0, 20

2 × SELECT a.id as id,a.type as type,a.name as name,a.clickurl as clickurl,a.cid as cid,a.params as params,a.custombannercode as custombannercode,a.track_impressions as track_impressions,cl.track_impressions as client_track_impressions FROMkoul8_banners as a LEFTJOINkoul8_banner_clientsAS cl ON cl.id = a.cid