当前位置:网站首页>sqlalchemy 判断一个array 类型的字段是否和一个array有至少一个一致的数据
sqlalchemy 判断一个array 类型的字段是否和一个array有至少一个一致的数据
2022-07-31 12:22:00 【小兜全糖(Cx)】
假如我们有一个model types列是一个Column(Array(Integer))
现有一个需求就是判断数据库的数据与给定的查询array之间是否至少有一个是一致的。假如这个array存的数据是{1,2,3,4} ,查询条件是{1,5,6},则应该返回True
可以使用overlap
query = DBSession.query(Question).order_by(Question.created_at.desc())
query = query.filter(Question.types.overlap([1,5,6]))
https://docs.sqlalchemy.org/en/14/dialects/postgresql.html
边栏推荐
- Acwing第 62 场周赛【未完结】
- How MySQL's allowMultiQueries flag relates to JDBC and jOOQ
- Indoor real-time laser SLAM control method based on biological excitation neural network
- 基于C51实现按键控制
- 使用docker搭建mysql主从
- 榕树贷款GPU 硬件架构
- 【Shader】Shader官方示例[通俗易懂]
- 消息队列面试题(2022最新整理)
- 系统集成项目管理工程师(软考中级)知识点总结【挣值分析】【关键路径】
- 0x80070570文件或目录损坏且无法删除(0x80070091怎么删除)
猜你喜欢
随机推荐
订song餐系统
Indoor real-time laser SLAM control method based on biological excitation neural network
ASM module in SAP Ecommerce Cloud Spartacus UI and Accelerator UI
How MySQL's allowMultiQueries flag relates to JDBC and jOOQ
在 Excel 内使用 ODBC 消费 SAP ABAP CDS view
Different lower_case_table_names settings for server (‘1‘) and data dictionary (‘0‘) 解决方案
想吃菌子,当然是自己上山找了
第十二章 使用中的 OpenAPI 属性
Data Lake (19): SQL API reads Kafka data and writes it to Iceberg table in real time
Fully Dynamically Constrained Robot Efficient Time-Optimal Trajectory Planning
JVS低代码能力简介及功能清单
Standard SQL/JSON - the sobering part
字符函数和字符串函数
kubernetes之服务发现
跨境电商小知识之跨境电商物流定义以及方式讲解
基本语法(一)
Three-Phase PWM Rectifier Predictive Direct Power Control
Docker practical experience: Deploy mysql8 master-slave replication on Docker
Use Excel to read data exposed by SAP ABAP CDS View through ODBC
file contains vulnerabilities









