I am trying to fetch the column values from Cursor object and use them into select statement with aggregate function and group by clause and put the data into another table but getting error.
Code
sql10 = f"""SELECT col1,col2,col3,col4 FROM tablename ORDER BY col4 ;"""
select_snow =cs.execute(sql10).fetchall()
snow_col = [(c[1],c[2]) for c in select_snow]
cursor.fast_executemany = True
sql17 = f"INSERT INTO newtable(col11,col12) (SELECT ?,MAX(?) FROM select_snow GROUP BY ?);"
Error
"ERROR: Unexpected error! - ('Expected 3 parameters, supplied 2', 'HY000')"