我的紅移表中有一個 JSON 陣列,其中包含True/False/None值。現在由于 JSON 只接受小寫值而不接受None,我想將這些值轉換為小寫true/false/null值。在我看來,我的 JSON 陣列有一些鍵,其值也包含名稱 True。
例子 :
[{“id”:20198,“name”:“True Ventures”,“path”:“true_ventures”,“type”:“Fund”,“lead”:False},{“id”:324746,“name” : "XXX", "path": "XXX", "type": "Investor", "url": "XXX", "image": "XXX", "lead": False}]
[{“id”:20198,“name”:“True Ventures”,“path”:“true_ventures”,“type”:“Fund”,“lead”:True},{“id”:324746,“name” : "XXX", "path": "XXX", "type": "Investor", "url": "XXX", "image": "XXX", "lead": True}]
[{“id”:20198,“name”:“True Ventures”,“path”:“true_ventures”,“type”:“Fund”,“lead”:無},{“id”:324746,“name” : "XXX", "path": "XXX", "type": "Investor", "url": "XXX", "image": "XXX", "lead": None}]
現在,我想在有, ,值False/True/None的地方替換整個 JSON 陣列中出現的值。(在這種情況下是主鍵,而不是公司的名稱和路徑)。我目前正在使用TrueFalseNone
case
when column_name ilike ('%True%') then regexp_replace(replace(column_name, '\'', '"'), 'True', 'true')
when column_name ilike ('
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/435543.html
上一篇:JQ-列印特定的鍵值對
