根据多个字段查询重复数据的总条数:python
sql = "select count(*) from tablea a where (a.askname, a.atime) in (select askname,atime from tablea group by askname,atime having count(*)>1) and askrepid not in (select min(askrepid) from tablea group by askname,atime having count(*)>1)" cursor.execute(sql) conn.commit() tables = cursor.fetchall() print 'result*********:',tables