a guest Apr 23rd, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- @rank := IF( @comp_id = company_id, @rank + 1, 1) AS day_rank,
- @comp_id := company_id AS company_id
- ORDER BY
- company_id, total_amount DESC
RAW Paste Data