我从 sqlalchemy 开始,到目前为止我有
import sqlalchemy
db = sqlalchemy.create_engine('mysql://CONNECTION?charset=utf8&use_unicode=0')
connection = db.connect()
db.echo = True
metadata = sqlalchemy.MetaData(db)
details_file = sqlalchemy.Table('details_file', metadata, autoload=True)
query = details_file.select([details_file.c.Id]).\
where(details_file.c.RunId == 5859)
res = query.execute()
我正在尝试的是只选择Id
符合 where 标准的列。我怎样才能做到这一点?