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


Messages In This Thread
how to write a query in mysql - by kvanaraj - 11-21-2018, 12:30 AM
RE: how to write a query in mysql - by Wouter60 - 11-21-2018, 07:47 AM
RE: how to write a query in mysql - by kvanaraj - 11-21-2018, 09:46 PM
RE: how to write a query in mysql - by php_rocs - 11-23-2018, 08:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB