Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set @startDate = "2019-04-15 00:00:00";
- select
- sum(c.amount) as amount
- from charges c
- where convert_tz(c.created_at, '+0:00','+8:00') >= @startdate
- and convert_tz(c.created_at, '+0:00','+8:00') <= date_add(@startdate, interval 7 day)
- and c.state = 'normal'
- and c.kind not in ('rent','d2d','oneway','mileage','subscriptionFee')
- #group by c.kind
- ;
Advertisement
Add Comment
Please, Sign In to add comment