1

是否可以使用 PyPika 使用列表来选择字段来构建 SQL 查询?尝试类似于以下内容来构建 SQL 查询。

from pypika import Query, Table
customers = Table('data_table')
field_list = ['user', 'age']
sql = Query.from_(customers).select(field_list).where(
    (customers.start_time >= start_time) &
    (customers.end_time <= end_time) &
    (customers.pair == pair)
)
4

0 回答 0