gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 12:28:54 25 4
gpt4 key购买 nike

<分区>

我已经在 postgres sql 中用列别名写下了这个查询,它工作正常:

select email as e from users 

它在 e 列别名下显示我的结果,但是当我用 e 触发 where 条件时,它会显示此错误:

select email as e from users where e = 'jaskaransingh@demo.com'

ERROR: column "e" does not exist

为什么会这样?我们如何在 where 条件下使用别名?

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