values = tuple(tuple(sub) for sub in <cursor.fetchall()_data>) value = (", ".join(map(repr,values))) values = values.replace("None", "NULL")