MySQL中sqlalchemy
offset的用法:设置查询得起点位置
limit的用法:设置查询多少数据
clickhouse中infi.clickhouse_orm
clickhouse中paginate(page_num=1, page_size=10)
下面是两者之间的替换:
operation_records = operation_record_query.order_by(desc('operation_time')).offset(
(page - 1) * rows).limit(rows).all()
operation_records = operation_record_query.order_by(desc('operation_time')).paginate(
page, rows)
sql语句操作
例子:展示第3页,每页展示6条
select a,b form t ORDER BY b DESC LIMIT 6 OFFSET (3-1)*6