Welcome Guest, Not a member yet? Register   Sign In
how to write a query in mysql
#1

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 ?
Reply
#2

Quote:how to write ?

Hire a programmer.
Reply
#3

(11-21-2018, 07:47 AM)Wouter60 Wrote:
Quote:how to write ?

Hire a programmer.

are u interested?
Reply
#4

@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.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB