How to retrieve JSON Object data MySQL select query - Hack The Tech - Latest News related to Computer and Technology

Hack The Tech - Latest News related to Computer and Technology

Get Daily Latest News related to Computer and Technology and hack the world.

Friday, June 23, 2023

How to retrieve JSON Object data MySQL select query

I Have one table i.e discount_details. I have 2 columns are the ID , DiscountTotal. I want to sum the each record line total json object with in the D array (64,10,10 are the 1st record values) . Like here 64,10,10 are the values,need to sum total value as 84 in the select query of MYSQL. I tried below examples but not working. Can please help on this issue.

SELECT  JSON_EXTRACT(`DiscountTotal`, '$.D') AS total FROM tablename 

enter image description here



source https://stackoverflow.com/questions/76534666/how-to-retrieve-json-object-data-mysql-select-query

No comments:

Post a Comment