2016-04-26 54 views
0

以下SQL语句中的第二列从JSONB列(entity_json)中检索Platform__c属性。有没有办法在Sequelize.js中包含JSONB中包含的属性?

当我尝试使用语法["account_name", "entity_json ->> 'Platform__c'"]作为列名称时,它失败。与此错误:"column \"entity_json ->> 'Platform__c'\" does not exist"

Sequelize.js有没有办法检索此列使用文档中突出显示的一些语法?

SELECT "account_name", entity_json ->> 'Platform__c' test 
FROM "sfdc"."mt_account" AS "Account" WHERE "Account"."account_name" ILIKE 
'somecustomer' LIMIT 10; 

回答

0

尝试以下语法

SELECT "account_name", "entity_json"#>>'{Platform__c}' test 
    FROM "sfdc"."mt_account" AS "Account" WHERE "Account"."account_name"  ILIKE 'somecustomer' LIMIT 10; 
相关问题