1
我發現大多數的你追問這個tread,但我有問題可以得到正確的位出我的查詢,jsonb搜索,只顯示規格值
的jsonb列如下:
[
{"price": 67587, "timestamp": "2016-02-11T06:51:30.696427Z"},
{"price": 33964, "timestamp": "2016-02-14T06:49:25.381834Z"},
{"price": 58385, "timestamp": "2016-02-19T06:57:05.819455Z"}, etc..
]
查詢看起來是這樣的:
SELECT * FROM store_product_history
WHERE EXISTS (SELECT 1 FROM jsonb_array_elements(store_prices)
as j(data) WHERE (data#>> '{price}') LIKE '%236%');
這當然給了我完整行的結果,但我想只得到像從行唯一的時間戳值,我這可能嗎?