标签: python python-3.x sqlite
如果我在python中执行SQL查询,它将返回一个游标对象,但找不到任何返回列名的函数。
我希望能够做这样的事情:
import sqlite3 as sql connection = sql.connect('db.db') print(connection.cursor().execute('SELECT first AS a, second AS b, third AS c FROM table').column_names()) >>> ['a', 'b', 'c']