<p>What is the accepted practice for indenting SQL statements?  For example, consider the following SQL statement:</p>

<pre><code>SELECT column1, column2
FROM table1
WHERE column3 IN
(
SELECT TOP(1) column4
FROM table2
INNER JOIN table3
ON table2.column1 = table3.column1
)
</code></pre>

<p>How should this be indented?  Many thanks.</p>

This is my personal method.  Depending on the length of the join condition I sometimes indent it on the line below.
```
```
SELECT
  column1,
  column2
FROM
  table1
WHERE
  column3 IN ( 
    SELECT TOP(1)
      column4
    FROM
      table2
      INNER JOIN table3 ON table2.column1 = table3.column1
  )

SELECT
  column1,
  column2
FROM
  table1
WHERE
  column3 IN ( 
    SELECT TOP(1)
      column4
    FROM
      table2
      INNER JOIN table3
        ON table2.column1 = table3.column1 -- for long ones
  )
```
```