Advertisement
oquidave

empty dates

May 13th, 2011
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. date | sum
  2. ------------+-------
  3. 2011-04-29 | 34350
  4. 2011-04-28 | 34650
  5. 2011-04-27 | 34050
  6. 2011-04-26 | 35550
  7. 2011-04-25 | 34800
  8. 2011-04-23 | 36750
  9. 2011-04-22 | 37800
  10. 2011-04-21 | 35550
  11. 2011-04-20 | 35850
  12. 2011-04-17 | 34050
  13. 2011-04-16 | 36150
  14. 2011-04-13 | 36450
  15. 2011-04-11 | 32100
  16. 2011-04-10 | 36600
  17. 2011-04-09 | 41400
  18. 2011-04-06 | 38100
  19. 2011-04-05 | 35250
  20. 2011-04-04 | 35400
  21. 2011-04-03 | 36150
  22. 2011-04-02 | 36000
  23. 2011-04-01 | 0
  24. 2011-03-31 | 36300
  25. 2011-03-30 | 36300
  26. 2011-03-25 | 37200
  27.  
  28. //query
  29.  
  30. select date(t_stamp), sum(total_charge) from mt.mt_batches where complete='t' and keyword='pablo'and date(t_stamp) between '2011-01-01' and '2011-04-30' group by date(t_stamp) order by date(t_stamp) desc;
  31.  
  32. //question
  33. i want 0 value entered for the dates that are not there.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement