DeveloperBreeze

Json In Mysql Development Tutorials, Guides & Insights

Unlock 1+ expert-curated json in mysql tutorials, real-world code snippets, and modern dev strategies. From fundamentals to advanced topics, boost your json in mysql skills on DeveloperBreeze.

Selecting the Sum of a JSON Property in MySQL

Tutorial August 17, 2024
json mysql

SELECT SUM(CAST(JSON_UNQUOTE(JSON_EXTRACT(order_details, '$.price')) AS DECIMAL(10,2))) AS total_revenue
FROM orders;

This will sum up the prices from each order and return the total revenue.