我有一個如下所示的 postgreSQL 列:
{
"table": false,
"time": {
"user": {
"type": "admin"
},
"end": {
"Always": null
},
"sent": {
"Never": 1356
},
"increments": 5,
"increment_type": "weeks",
"type": "days"
}
}
我想從 json 檔案中提取“Increments = 5 and Increment_type=weeks)。結果將是 -- Column_a = 5 周
uj5u.com熱心網友回復:
使用取消參考運算子,->并->>獲得您需要的內容:
select concat(
colname->'time'->>'increments',
' ',
colname->'time'->>'increment_type'
) as column_a
from tablename;
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/492801.html
標籤:PostgreSQL
上一篇:在SQL資料庫中創建全文索引
