Skip to content

AL03 — Complex select expression should be aliased

Group: Aliasing · Auto-fixable: no

A select target that is a function call, arithmetic expression, CASE, etc. has no inherent name, so the resulting column gets an opaque auto-generated label. Name it with AS.

bad: SELECT count(*) FROM t
good: SELECT count(*) AS total FROM t

Disable this rule in banshee.toml:

[lint]
exclude = ["AL03"]

Or silence one line with -- noqa: AL03. See Linting.