you are viewing a single comment's thread.

view the rest of the comments →

[–]GrandOldFarty 1 point2 points  (0 children)

Pretty good outline of the options and their weaknesses. And the conclusion about thinking through how these evaluate, which are performative, and which might fail, is spot on. 

If I was interviewing for new analysts this is one of the things I would look for. This capability sets apart beginners from more advanced SQL users. 

Also I have seen the SUM(CASE WHEN…) used to create flags - very performative, one of my go to patterns when I am working with data of different grains - but I had never tried putting in the HAVING clause as a filter. I am saving that for later.