Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT count(*) AS thirty_day_sales FROM "MySchema"."MyTable" MT
- WHERE MT.date > now()::date - interval '30 days'
- UNION
- SELECT count(*) AS sixty_day_sales FROM "MySchema"."MyTable" MT
- WHERE MT.date > now()::date - interval '60 days'
- UNION
- SELECT count(*) AS ninety_day_sales FROM "MySchema"."MyTable" MT
- WHERE MT.date > now()::date - interval '90 days'
Add Comment
Please, Sign In to add comment