我在jsosnb列的多行中有不同样本的基因表达数据,如下所示:
Sample Gexp
Sample A {"data": [{"pval": 0.0154, "Protein": "A0A0B4J2D5", "FoldChange": 1.3534, "MinusLog10p": 0.1334, "Significance": "Non-significant"}, {"pval": 0.0689, "Protein": "A0FGR8", "FoldChange": 2.5448, "MinusLog10p": 1.1615, "Significance": "Significant"}]}
Sample B {"data": [{"pval": 0.0824, "Protein": "A0A0B4J2D5", "FoldChange": -0.1676, "MinusLog10p": 0.1084, "Significance": "Non-significant"}, {"pval": 0.0219, "Protein": "A0FGR8", "FoldChange": 2.3448, "MinusLog10p": 1.1615, "Significance": "Significant"}]}
我需要查询包含多个记录的列,其中某个蛋白质的pval或FoldChange在某个范围内。我尝试了这个论坛提供的多种解决方案(Search in nested Postgresql JSONB column,Postgresql query for objects in nested JSONB field,Query simplified JSONB form JSONB column containing nested JSON from a Postgresql database?,How to query nested array with heterogeneous elements in PostgreSQL JSONB column等),但没有成功。有人能帮助我吗?
1条答案
按热度按时间a64a0gku1#
问题中没有精确地(明确地)描述数据选择的条件,例如,当我们在
0.02
到0.03
的pval
范围内寻找A0FGR8
蛋白质时,查询可能如下所示:在Db<>fiddle.中测试查询