Is there a way to retrieve SQL result column value using column name instead of column index in Python? I\'m using Python 3 with mySQL. The syntax I\'m looking for is pretty
import mysql.connector as mysql ... cursor = mysql.cnx.cursor() cursor.execute('select max(id) max_id from ids') (id) = [ id for id in cursor ]