"select creator_id,id from community_pictorial where is_online =True and is_deleted=False and id not in (select pictorial_id from reply group by pictorial_id)")
cursor.execute("select count(*),pictorial_id from reply group by pictorial_id")
data=cursor.fetchall()
topic_id=list(data)
logging.info("Database version : %s "%topic_id)
returntopic_id
data_all=[]
foriintopic_id:
iftopic_id[0]<=4:
cursor.execute("select creator_id,id from community_pictorial where is_online =True and is_deleted=False and id in (select count(*),pictorial_id from reply group by pictorial_id)")