Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3628 Lượt xem

i want to extract data from table: product_template field "name" where data is in json format, i want to extract portion of data as below (2nd screenshot) in blue rectangle (without double quotes " ), please help how i can do it? 


i am using PgAdmin4, here are 2 screenshots:



regards


 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

Please try this query,

SELECT name ->> 'en_US' AS product_name FROM product_template;

Output:


Thanks

Ảnh đại diện
Huỷ bỏ
Tác giả

thanks for help... it works fine.
but, as mentioned, i want it without double quotes " ... how to remove it?
regards

I have updated the answer, please check

Tác giả

thanks a bunch!!! brillieant !! it saves to write a function. i thought i have to write a function and use replace function to eliminate double quotes.
regards

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 5 25
2440
1
thg 4 25
3461
1
thg 4 25
4281
1
thg 4 25
1770
4
thg 3 25
6872