2016-04-26 78 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; 
相關問題