SQL Formatting WITH Expressions Commas

I need to align commas in WITH expression. Currently my formatting options gives me this (check the alignment of the comma before , P as)

WITH O AS (
  SELECT id AS org_id, name, description, another_field
  FROM all_organizations
  NATURAL JOIN all_names
  WHERE status >= 1
)
   , P AS (
  SELECT id AS per_id, name_0, name_1, name_2, name_3
  FROM all_personnel
  NATURAL JOIN all_names
  WHERE status >= 1
)
   , C AS (
  SELECT org_id, per_id, note
  FROM all_contacts
  WHERE status >= 1
)
SELECT O.*, P.*
FROM O, P, C

 

But I want to get this format (commas aligned with WITH)

WITH O AS (
  SELECT id AS org_id, name, description, another_field
  FROM all_organizations
  NATURAL JOIN all_names
  WHERE status >= 1
)
, P AS (
  SELECT id AS per_id, name_0, name_1, name_2, name_3
  FROM all_personnel
  NATURAL JOIN all_names
  WHERE status >= 1
)
, C AS (
  SELECT org_id, per_id, note
  FROM all_contacts
  WHERE status >= 1
)

 

Thanks in advance.

 

0
1 comment

Hi Homam,

You'll need to tweak the formatting settings in File | Settings | Editor | Code Style | SQL | General

To customize the formatting the way you want it, you need to configure the settings as per below:

0

Please sign in to leave a comment.