Skip to content

Instantly share code, notes, and snippets.

@mshakhomirov
Created November 24, 2022 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mshakhomirov/933e6a358e49dcccd4e547a5509c8fda to your computer and use it in GitHub Desktop.
Save mshakhomirov/933e6a358e49dcccd4e547a5509c8fda to your computer and use it in GitHub Desktop.
with daily_revenue as (
select
current_date() as dt
, 100 as revenue
union all
select
date_sub(current_date(), interval 1 day) as dt
, 100 as revenue
)
select
*
from daily_revenue
where
if(revenue >101,1,0) = 1
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment