我很少说英语。
我有一个 sql 子查询错误
数据库:MySQL
表类型:MyISAM
以下我的 sql 查询
SELECT
(SELECT sum(`total`) FROM `staff_history` WHERE `type` = 'Giriş' AND staff_id = table_1.staff_id) AS `input`,
(SELECT sum(`total`) FROM `staff_history` WHERE `type` = 'Çıkış' AND staff_id = table_1.staff_id) AS `output`,
(`input` - `output`) AS `balance`
FROM `staff_history` AS `table_1` WHERE `staff_id` = '2';
我收到这样的错误
Error code 1054, SQL status 42S22: Unknown column 'input' in 'field list'
你能帮我解决这个问题吗?