我正在尝试做这件事:
select first_name || ' ' || last_name as full_name, Length(full_name) as len from customer order by len
这是不可能的;
"full_name"列不存在
因此,我必须这样做:
select first_name || ' ' || last_name as full_name, Length(first_name || ' ' || last_name) as len from customer order by len
这是否意味着SQL引擎必须两次计算表达式'first_name || ' ' || last_name'?
select
(或where
)中重复使用别名。你也可以使用CTE或子查询。 - undefined