获得查询结果表的列名:
- db = sqlite.connect('data.db')
- cur = db.cursor()
- cur.execute("select * from table")
- col_name_list = [tuple[0] for tuple in cur.description]
- print col_name_list
获得所有列名:
- cur.execute("PRAGMA table_info(table)")
- print cur.fetchall()
获得查询结果表的列名:
获得所有列名:
java根据表名称获取所有字段
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M