Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3622 มุมมอง

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


 

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

Please try this query,

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

Output:


Thanks

อวตาร
ละทิ้ง
ผู้เขียน

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

ผู้เขียน

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ค. 25
2434
1
เม.ย. 25
3454
1
เม.ย. 25
4272
1
เม.ย. 25
1759
4
มี.ค. 25
6865