SELECT 1 as qq , 2 as ww , qq/ww as percent;
错误提示:
[SQL]
SELECT 1 as qq , 2 as ww , qq/ww as percent;
[Err] 1054 - Unknown column 'qq' in 'field list'
正确该如何写?
SELECT 1 as qq , 2 as ww , qq/ww as percent;
错误提示:
[SQL]
SELECT 1 as qq , 2 as ww , qq/ww as percent;
[Err] 1054 - Unknown column 'qq' in 'field list'
正确该如何写?
SELECT
t1.qq,
t2.ww,
t1.qq / t2.ww AS percent
FROM
(SELECT 1 AS qq) t1,
(SELECT 2 AS ww) t2