![](/img/trans.png)
[英]Select Rows postgres SQL where Key = String for all elements of Jsonb Array
[英]Select rows where jsonb array contains any string in array
到目前為止,這是我的SQL:
select * from table where table.json_info @> '{"search_tags":["hello", "world"]}'
如果行在search_tags
hello
又有world
我想知道是否有一種方法可以包含具有“ hello
或“ world
行,當然也可以包括具有兩者的行。
感謝所有提前!
感謝@utility使我在這里走上正軌。
這就是我的想法:
select * from table where table.json_info @> '{"search_tags":["hello"]}' or table.json_info @> '{"search_tags":[ "world"]}'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.