SQL

SQL

By DeepSource

Use of brackets wrapping top-level code SQL-L053

Style
Minor

Top-level statements should not be wrapped in brackets.

Bad practice

In this example, the two SUM functions don't have the same capitalisation.

(SELECT
    foo
FROM bar)

-- This also applies to statements containing a sub-query.

(SELECT
    foo
FROM (SELECT * FROM bar))

Recommended

SELECT
    foo
FROM bar

-- Likewise for statements containing a sub-query.

SELECT
    foo
FROM (SELECT * FROM bar)