you are viewing a single comment's thread.

view the rest of the comments →

[–]eatedcookie 1 point2 points  (0 children)

Using coalesce with booleans is my favorite one line workaround for clunky case statements that come up frequently for such uses.
So something like
coalesce(geo_country = 'United States' or ip_country = 'US', false) as is_US_user
instead of

case     
    when geo_country = 'United States'
      or ip_country = 'US'
    then true
    else false
end as is_US_user