Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 244105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:58:37+00:00 2026-05-11T20:58:37+00:00

Do you place separators (commas, and, or operators) at the front of the line?

  • 0

Do you place separators (commas, and, or operators) at the front of the line?

Select Field1
    , Field2
  --, Field3
From [some_table] as ST
Inner Join [other_table] as OT
   ON ST.PKID = OT.FKID
Where [this] = [that]
   and [one_other] > 53;

I think the best feature is to help expose important operators (AND/OR). As a secondary advantage it seems easier to comment out.

Not sure where I picked it up initially, but Andrew Novick mentions it in “Transact-SQL User-Defined Function” (Heard him speak; got the book for free and highly recommend.)

  • 1 1 Answer
  • 4 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:58:37+00:00Added an answer on May 11, 2026 at 8:58 pm

    At my workplace (small consultancy company with about 10 developers, specialising in Oracle) that is what our convention is, as so:

    SELECT
      p.id pd_id
    , p.var_no
    , p.status
    , o.name operator
    , o.r_id
    , o.r_type
    , o.start_datetime
    , o.end_datetime
    --, p.id rd_id
    --, p.s_control
    , p.xml_data last_d_res_xml
    FROM schema_a.table_x p
    JOIN schema_b.table_y o ON p.id = o.pd_id
    WHERE p.some_id = 11
    ORDER BY pd_id DESC, end_datetime DESC NULLS FIRST
    

    We find it is quite clear and allows easy commenting of columns when debugging. It took a while to get used to but I prefer this style now – and it is consistently used by our whole team.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: .NET String.Format() to add commas in thousands place for a number i
I'm reading from a CSV, line by line and tokenizing each comma separated value.
I'm trying do something like this: SELECT * FROM table WHERE column IN (1,2,3)
My place of work currently uses CVS. A git migration is planned but it
Every place I've worked in the past 15 years has had, on almost every
I place the .html (which consist of the .js web link) file in the
Every place I have looked all I can find is how to read a
I place many checks of the program state, whose failure would indicate a bug
I want to place a login inline-form in a twitter navbar. I have done
I want to place panels horizontally, but when I drag panels they are going

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.