1、构造适合postgtresql待查询的字段列表:
celllist=“‘,’”.join(list(set(sitelist[‘站址名称’])))
celllist=“('”+celllist+“')”
2、通过赋值查询包含关系
msql = “select * from “局站历史月支付台账-%s市” where 出账年>=‘%s’ and 局站名称 in %s order by 局站名称,出账年,出账月” % (
city, yearday,celllist)
postgresql 通过字段list查询包含关系
最新推荐文章于 2023-12-21 10:00:25 发布