🎉 SQLFluff Online 🎉

SQLFluff is a SQL formatter that is implemented in Python. You can use this app to format one-off, adhoc sql that might not be worth saving to a file. Or you can use it to see what SQLFluff thinks of your queries. It's up to you!

You can check out the source code for this application on GitHub (click).

Paste your SQL and select your dialect. Hit that button and find your fixed SQL with the associated linter errors. Enjoy, friends 🌝.


Your Terrible SQL



SQLFluff is maintained by a group of talented attractive and selfless people who are all driven by a common disdain for poorly formatted SQL. If you like fluff's treatment of your queries, feel encouraged to check out our group on GitHub!

This app runs on SQLFluff version 0.5.2, and applies all rules in that version. Here is a list of them:

Rule Description
L001 Unnecessary trailing whitespace.
L002 Mixed Tabs and Spaces in single whitespace.
L003 Indentation not consistent with previous lines.
L004 Incorrect indentation type.
L005 Commas should not have whitespace directly before them.
L006 Operators should be surrounded by a single whitespace.
L007 Operators near newlines should be after, not before the newline.
L008 Commas should be followed by a single whitespace unless followed by a comment.
L009 Files must end with a trailing newline.
L010 Inconsistent capitalisation of keywords.
L011 Implicit aliasing of table not allowed. Use explicit `AS` clause.
L012 Implicit aliasing of column not allowed. Use explicit `AS` clause.
L013 Column expression without alias. Use explicit `AS` clause.
L014 Inconsistent capitalisation of unquoted identifiers.
L015 DISTINCT used with parentheses.
L016 Line is too long
L017 Function name not immediately followed by bracket.
L018 WITH clause closing bracket should be aligned with WITH keyword.
L019 Leading/Trailing comma enforcement.
L020 Table aliases should be unique within each clause.
L021 Ambiguous use of DISTINCT in select statement with GROUP BY.
L022 Blank line expected but not found after CTE closing bracket.
L023 Single whitespace expected after AS in WITH clause.
L024 Single whitespace expected after USING in JOIN clause.
L025 Tables should not be aliased if that alias is not used.
L026 References cannot reference objects not present in FROM clause.
L027 References should be qualified if select has more than one referenced table/view.
L028 References should be consistent in statements with a single table.
L029 Keywords should not be used as identifiers.
L030 Inconsistent capitalisation of function names.
L031 Avoid table aliases in from clauses and join conditions.
L032 Prefer specifying join keys instead of using "USING".
L033 UNION [DISTINCT|ALL] is preferred over just UNION.
L034 Use wildcards then simple select targets before calculations and aggregates.
L035 Do not specify "else null" in a case when statement (redundant).
L036 Select targets should be on a new line unless there is only one select target.
L037 Ambiguous ordering directions for columns in order by clause.
L038 Trailing commas within select clause.
L039 Unnecessary whitespace found.
L040 Inconsistent capitalisation of boolean/null literal.
L041 SELECT clause modifiers such as DISTINCT must be on the same line as SELECT.
L042 Join/From clauses should not contain subqueries. Use CTEs instead.
L043 Unnecessary case when statement. Use the "when" condition itself.
L044 Query produces an unknown number of result columns.
L045 Query defines a CTE (common-table expression) but does not use it.
L046 Jinja tags should have a single whitespace on either side.
L047 Use consistent syntax to express "count number of rows".
L048 Quoted literals should be surrounded by a single whitespace.