How do I calculate two aliases’ values in MySQL?
How do I calculate these two aliases and show them in other columns? SELECT SUM(qty1) AS ali_qty1, (SELECT SUM(qty2) FROM table2 WHERE col2 = 'B') AS ali_qty2, (SELECT SUM(ali_qty1) - SUM(ali_qty2) as total_qty) FROM table1 WHERE col1= 'A' table1 ID…