Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Writing more legible SQL (craigkerstiens.com)
3 points by craigkerstiens on Jan 8, 2016 | hide | past | favorite | 3 comments


I'll admit to giving little thought to the legibility of my SQL - this is a quick read, with some solid tips.

Do you do anything in particular to make your queries more digestible?


Craig mentions this in the piece, but I'll second it:

I fucking love CTE's for breaking apart ugly looking queries. They make everything significantly easy to read.


Yep, this is essentially the biggest piece. Using CTEs and having building blocks that are easy to logically follow is the single biggest thing you could do.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: