gpt4 book ai didi

sql - 如何在 WHERE 子句中引用列别名

转载 作者:行者123 更新时间:2023-12-02 07:16:36 34 4
gpt4 key购买 nike

<分区>

我想比较别名(其中包含空格)和 WHERE 子句中的空格。

select r.resortid, sum(b.adultcount+b.childcount) as "Total Guest"
from resort r, booking b
where r.resortid = b.resortid and "Total Guest" <= 10
group by r.resortid
order by r.resortid;

我得到的错误是:

where  r.resortid=b.resortid and "Total Guest" <=10
*
ERROR at line 3:
ORA-00904: "Total Guest": invalid identifier

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com