Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

These were all adhoc analytics queries, not the sort of thing that get checked in.

It means you can copy paste any where condition because they are all of the form

   AND <condition>
otherwise one condition is of the form

  WHERE <condition 1>
So adding it to a query that already has a where clause is a bit more awkward.

I use this technique for some analytics queries that all rely on the same base table. It’s not uncommon to start with copying an old query and just adding or removing conditions and grouping/aggregating until I get the right data. Using this format also makes commenting out any condition trivial.

  WHERE true
  --    AND some_column = “some value”
      AND event = “SOME_EVENT_TYPE”
      AND EXISTS(SELECT * FROM UNNEST(array_column) as v WHERE v = “some value”)
I don’t see how you could achieve this result with just IDE formatting.


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

Search: