Column Alias in a WHERE Clause

前端 未结 3 820
面向向阳花
面向向阳花 2021-01-12 17:27

Problem

I am using alternate column name (alias) in a Query, I can use the alias "given_name" as part of the ORDER BY but am unable to use it as part of t

3条回答
  •  不知归路
    2021-01-12 18:03

    You can only use column aliases in GROUP BY, ORDER BY, or HAVING clauses.

    Standard SQL doesn't allow you to refer to a column alias in a WHERE clause. This restriction is imposed because when the WHERE code is executed, the column value may not yet be determined.

提交回复
热议问题