Hacker News .hnnew | past | comments | ask | show | jobs | submitlogin

> God is merciful because AND_ is 4 characters, a good tab width, so WHERE conditions are to be lined up like (same for JOIN conditions)

  WHERE
          country = 'UAE'
      AND day >= DATE('2019-07-01')
      AND DAY_OF_WEEK(day) != 5
      AND scheduled_accuracy_meters <= 10*1000
It looks better when you use a tab-width of 2:

  WHERE country = 'UAE'
    AND day >= DATE('2019-07-01')
    AND DAY_OF_WEEK(day) != 5
    AND scheduled_accuracy_meters <= 10*1000


I don’t know if this will go over well, but how about the infamous 1=1?

    WHERE 1=1
      AND country = 'UAE'
      AND day >= DATE('2019-07-01')
      AND DAY_OF_WEEK(day) != 5
      AND scheduled_accuracy_meters <= 10*1000

(More reading: https://stackoverflow.com/q/242822)


WHERE TRUE would also work, so would WHERE 1 I believe




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

Search: