假设一个包含JSON列的Postgresql表。现在我如何只获得那些匹配某个'JSON-Schema'的表行?
我希望
select category#>'{Kategorie}' from dataset where category#>'{Kategorie}' is not null
只会获得与{Kategorie} Schema匹配的那些行。
答案 0 :(得分:0)
感谢@dommage提供的指针,语法实际上是
select category#>'{Kategorie}' from dataset where (category#>'{Kategorie}') is not null
在where子句中json-extraction操作的parantheses是至关重要的。