connection.execute(sql)(0)0的意思

来源:互联网 发布:淘宝网首页假发 编辑:程序博客网 时间:2024/04/30 13:11

由于connection对象的execute()方法返回的是记录集recordset,而recordset又可以通过recordset.fields.item(0).value(简写recordset(0))来获取第一列的字段内容,以此类推,connection.execute(sql)(0)也是来获取第一列的字段内容。

该方法可以应用到求返回的记录总数,如:rscount=conn.execute("select count(id) from table",0,1)(0)

原创粉丝点击