我有LOWER(Owner)
SELECT LOWER(Owner) FROM ...
的查询结果
但我希望此LOWER(Owner)
代表name
,但我的查询错误提示:#1054 - Unknown column 'Owner' in 'field list'
SELECT LOWER(Owner) AS name FROM (
SELECT LOWER(Owner) FROM ...
) AS buyers
答案 0 :(得分:1)
这是因为子查询没有列owner
。所以添加这样的别名:
SELECT owner FROM (
SELECT LOWER(Owner) AS Owner FROM ...
) AS buyers
答案 1 :(得分:0)
将别名放在子查询中:
SELECT name
FROM (SELECT LOWER(Owner) as name FROM ...
) AS buyers