from sqlalchemy import create_engine
engine = engine = create_engine('sqlite:///...')
然后你就可以使用
from sqlalchemy.sql import text
with engine.connect() as conn:
statement = text("SELECT zone, count(fall_status) from events WHERE events.timestamp BETWEEN 1663460366 AND 1663546766 AND events.fall_status = 1 GROUP by zone")
conn.execute(statement)
2条答案
按热度按时间7fyelxc51#
首先,您需要创建一个引擎:
然后你就可以使用
c8ib6hqw2#
请参阅函数.计数