CodeIgniter Forums

Full Version: how to write a query in mysql
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Code:
Table
id    updated_on
1    2018-11-21 12:10:00
2    2018-11-22 10:10:00
3    2018-11-22 13:10:00
4    2018-11-23 10:10:00
5    2018-11-23 11:10:00
6    2018-11-23 11:50:00
7    2018-11-24 10:10:00
8    2018-11-25 10:10:00
9    2018-11-25 12:10:00
10    2018-11-25 14:10:00
Code:
output calculated as

date        count                      
2018-11-21    1   ----(an=1)
2018-11-22    2   ----(fn=1,an=1)
2018-11-23    1   ----(fn=0,an=1)
2018-11-24    1   ----(fn=1,an=0)
2018-11-25    2   ----(fn=1,an=1)



Code:
final output
date        count                      
2018-11-21    150  
2018-11-22    0
2018-11-22    300
2018-11-23    0
2018-11-23    0
2018-11-23    150
2018-11-24    150  
2018-11-25    0
2018-11-25    0
2018-11-25    300    





how to write ?
Quote:how to write ?

Hire a programmer.
(11-21-2018, 07:47 AM)Wouter60 Wrote: [ -> ]
Quote:how to write ?

Hire a programmer.

are u interested?
@kvanaraj,

Do you still need help with this? How do you come up with the fn values? This should be a pretty straight forward query.