且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在同一选择中使用列别名

更新时间:2023-11-29 22:37:52

按照标准SQL:在任何特定SELECT子句中的所有列都是好像"计算的,它们都是并行计算的(允许某些实现正是这样做的.)

Per standard SQL: All columns in any particular SELECT clause are computed "as if" they're all being computed in parallel (to allow some implementation to do precisely that).

因此,不允许您依赖同一SELECT子句中定义的另一列,因为尚未计算其值.

As such, you're not allowed to depend on another column defined within the same SELECT clause since it's value has not yet been computed.