AP 27 - Use an alias for inline views

Severity

Warning Caution

Type

Readability

Problem

You should follow best practices and add an alias to inline views

select x 
  from(select y as x 
         from t)

Solution

Use an alias for your inline view

select x
  from(select y as x
         from t) a

Note: Some databases will even raise an error if you don’t use an alias for an inline view.

Legitimate use of the anti pattern

None