表:
id list
1. [{A: Test, B: Test2},{A:Non, B:Non2}]
2. [{A: Rand, B: Rand2},{A:Temp, B:Temp2}]
3. [{A: Val, B: Val2},{A:Temp, B:Temp2}]
我想筛选此表中A
等于Temp
的行
所以剩下的表格是这样的:
id list
2. [{A: Rand, B: Rand2},{A:Temp, B:Temp2}]
3. [{A: Val, B: Val2},{A:Temp, B:Temp2}]
您可以使用any_match
函数和lambda表达式来查看数组内部:
SELECT *
FROM t
WHERE any_match(t.list, e -> e.A = 'Temp')