DEV Community

Discussion on: How to write SQL queries which are easier to read?

Collapse
 
javinpaul profile image
javinpaul

Hello @victor , first of all very valuable comment.

  1. I have corrected the typo, thanks for that.
  2. In the first version, it was indeed in one line but I had to break just to show that properly in this article.
  3. Yes, somehow indention lost in the image on 3rd, the capital version has a proper indentation.
  4. Yes, using WHERE 1=1 is a nice trick I learned to easily comment condition and try query.
  5. Regarding multiple UNION, could you elaborate more? I think this style will help but I generally use brackets ()
  6. For with queries also, I prefer brackets.

Once again thanks for the comment and making the article better.