SQL Formatter Option: Subquery newline after IN keyword

This format option control whether put a blank line after IN keyword when there is a subquery follows.

name: Subquery_Newline_After_IN, default is false

setting path: subquery -> Linebreak after IN keyword


SELECT od.[Discount],

       od.[Quantity],

       od.[Unitprice]

FROM   [northwind].[dbo].[ORDER DETAILS] AS od

WHERE  ( od.[Orderid] IN (SELECT o.[Orderid] AS [orderid]

                          FROM   [northwind].[dbo].[ORDERS] o

                          WHERE  (( o.[Customerid] IN (SELECT c.[Customerid] AS [customerid]

                                                       FROM   [northwind].[dbo].[CUSTOMERS] c) ))) ) 

After set Subquery_Newline_After_IN to true, SQL will be formatted like this:


SELECT od.[Discount],

       od.[Quantity],

       od.[Unitprice]

FROM   [northwind].[dbo].[ORDER DETAILS] AS od

WHERE  ( od.[Orderid] IN

         (SELECT o.[Orderid] AS [orderid]

          FROM   [northwind].[dbo].[ORDERS] o

          WHERE  (( o.[Customerid] IN

                    (SELECT c.[Customerid] AS [customerid]

                     FROM   [northwind].[dbo].[CUSTOMERS] c) ))) ) 

Newsletter Updates

Enter your email address below to subscribe to our newsletter