lst = ['DTS2323','DTS2343','DTS123']
con = sqlite3.connect(db)
sql1 = ' delete from alpm_dtsinfo where rowid not in(select max(rowid) from alpm_dtsinfo group by name) '
sql = "delete from alpm_dtsinfo where name in (%s)"%("'"+"','".join(lst)+"'")
cursor = con.cursor()
cursor.execute(sql1)
cursor.execute(sql)
con.commit()
print cursor.fetchall()
con.close()
cursor = con.cursor()
sql = "select name1 from alpm_dtsinfo where rank=9"
# cursor.execute(sql1)
cursor.execute(sql)
con.commit()
configstr = cursor.fetchone()[0].strip()
con.close()
print type(configstr)
print configstr
jsondata = json.loads(configstr)
print jsondata['alonGroup']['users']