कुछ इस तरह:
SELECT
s.*,
ROUND (
100.00 * (s.sale_item_1 + s.sale_item_2) /
(SELECT
SUM(sale_item_1 + sale_item_2)
FROM sales_db
WHERE orderNumber = s.orderNumber), 2) percentage
FROM sales_db s;
डेमो देखें
कुछ इस तरह:
SELECT
s.*,
ROUND (
100.00 * (s.sale_item_1 + s.sale_item_2) /
(SELECT
SUM(sale_item_1 + sale_item_2)
FROM sales_db
WHERE orderNumber = s.orderNumber), 2) percentage
FROM sales_db s;
डेमो देखें