假设我有
SET @json = '{
"orderItems" : [ {
"entity" : {
"@type" : "Data",
"actionType" : "ADD"
}
}, {
"entity" : {
"@type" : "Instance",
"actionType" : "REMOVE"
}
} ]
}';
,我想选择@type = Instance
和actionType = REMOVE
的实体。
我尝试过
select json_query(@json, '$.orderItems[?(@.entity.actionType == \'REMOVE\' && @.entity[\'@type\'] == \'Instance\')]');
但它返回null。