Querying into CrateDB objects and skip if property not exists

微笑、不失礼 提交于 2019-12-13 00:54:58

问题


I'm trying to make a query into my CrateDB querying in objects where a property may exist. But I'm having some issues getting a ColumnUnknownException.

My query looks quite easy:

SELECT "attrs","location" FROM "doc"."raw_foo" WHERE attrs['management_entity'] != "" LIMIT 100;

attrs column is an object with many attributes and, as I told before, some rows have management_entityproperty.

Thanks!


回答1:


Your query should have single quotes around not equal operator SELECT "attrs","location" FROM "doc"."raw_foo" WHERE attrs['management_entity'] != '' LIMIT 100;



来源:https://stackoverflow.com/questions/49734552/querying-into-cratedb-objects-and-skip-if-property-not-exists

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!