News for hackers. Stuff that matters.
Re:SQL Tips and Tricks by Izkata on Wednesday September 25, 2024 @09:02AM (#41647002)
For their one here it's just the ability to rapidly comment/uncomment conditions in a query editor while exploring the data or debugging the query, and not having to worry about the leading AND or OR.

I've also seen it in code with iterative adds, for example:

  for crit in criteria:
      sql += " AND " + crit
No needed to add a sentinel or other logic to skip the first AND. I saw it a lot before people got used to " AND ".join(criteria).
Re:SQL Tips and Tricks by regexman1 on Wednesday September 25, 2024 @09:18AM (#41647187)
That's right - it's just a quicker way of being able to comment/uncomment conditions when doing EDA or debugging.
Re:SQL Tips and Tricks by hot_gril on Wednesday September 25, 2024 @02:48PM (#41650642)
Yeah. Especially when I'm trying to see what makes some query slow.