SQL how to Count -


i have database phone , track on dates how many phone call or how many sms being period of 1 week example

database:phone  type | date/time  calls           | 04/01/14 0800hrs  sms            | 04/01/14 0850hrs  sms            | 04/01/14 0900hrs  calls           | 04/01/14 1230hrs  sms            | 04/01/14 1250hrs  calls           | 04/01/14 1300hrs  sms            | 08/01/14 1301hrs  calls          | 08/01/14 1330hrs 

how should create table , use count?which show

-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_  -no. of calls  || no. of sms-  -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_  -4             || 4         -  -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 

i foget add in. lets got user 1, 2 , 3. want search user 1 made how many phone calls , how many sms, user 2 made how many phone calls , how many sms , on. how should write it?

select type, count(*) phone [date/time] between x , y group type 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

angularjs - ng-repeat duplicating items after page reload -