{"id":1114,"date":"2011-09-27T04:48:51","date_gmt":"2011-09-27T09:48:51","guid":{"rendered":"http:\/\/www.dpriver.com\/blog\/?p=1114"},"modified":"2011-10-14T21:08:50","modified_gmt":"2011-10-15T02:08:50","slug":"sql-formatter-option-subquery-newline-after-comparison-operator","status":"publish","type":"post","link":"https:\/\/www.dpriver.com\/blog\/2011\/09\/sql-formatter-option-subquery-newline-after-comparison-operator\/","title":{"rendered":"SQL Formatter Option: Subquery newline after comparison operator"},"content":{"rendered":"

This format option control whether put a blank line after comparison operator when there is a subquery follows.<\/p>\n

name: Subquery_Newline_After_ComparisonOperator, default is false<\/p>\n

setting path: subquery -> Linebreak after comparison operator<\/p>\n

\nSELECT<\/span> *<\/span>
\n
FROM<\/span> T<\/span>
\n
WHERE<\/span> Somefield<\/span> =<\/span> (<\/span>SELECT<\/span> TOP<\/span> 1<\/span> Blah<\/span>
\n
FROM<\/span> T1<\/span>
\n
ORDER<\/span> BY<\/span> F<\/span>)<\/span>
\n<\/span><\/div>\n

After set Subquery_Newline_After_ComparisonOperator to true, SQL will be formatted like this:<\/p>\n

\nSELECT<\/span> *<\/span>
\n
FROM<\/span> T<\/span>
\n
WHERE<\/span> Somefield<\/span> =<\/span>
\n
(<\/span>SELECT<\/span> TOP<\/span> 1<\/span> Blah<\/span>
\n
FROM<\/span> T1<\/span>
\n
ORDER<\/span> BY<\/span> F<\/span>)<\/span>
\n<\/span><\/div>\n","protected":false},"excerpt":{"rendered":"

This format option control whether put a blank line after comparison operator when there is a subquery follows. name: Subquery_Newline_After_ComparisonOperator, default is false setting path: subquery -> Linebreak after comparison operator SELECT * FROM T WHERE Somefield = (SELECT TOP 1 Blah FROM T1 ORDER BY F) After set Subquery_Newline_After_ComparisonOperator to true, SQL will be formatted like this: SELECT * FROM T WHERE Somefield = (SELECT TOP 1 Blah FROM T1 ORDER BY F) <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18,24,22],"tags":[],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":5}},"yoast_head":"\nSQL Formatter Option: Subquery newline after comparison operator<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t\n