943,667 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 579
  • PHP RSS
Nov 19th, 2008
0

sql count total calls

Expand Post »
sorry to post it here.. i really need your attention..
thanx

hi guys! i am enim, i usually post thread in PHP and i guess its my first time here in mysql..

i have problem regarding the total count of the terminatecause..
i need the count of ANSWERED calls only and the total count of all calls..
can i do this in one query.. because my query below isn't working..

pls. help

thanx
enim

php Syntax (Toggle Plain Text)
  1. select destination, count(terminatecause) as tc CASE terminatecause
  2. when 'ANSWER' then count(terminatecause)
  3. end as allcall
  4. from tblTable1
  5. join tblTable2on tblTable1.someID = tblTable2.someID
  6. join tblTable3on tblTable2.someID1 = tblTable3.someID1
  7. where tblTable3.someID1= '1'
  8. and tblTable1.someUser= 'user'
  9. and tblTable1.callstarttime between '2008-08-01 00:00:00' and '2008-08-01 23:00:00'
  10. group by destination, terminatecause order by destination asc
Last edited by enim213; Nov 19th, 2008 at 11:20 pm.
Similar Threads
Reputation Points: 11
Solved Threads: 2
Light Poster
enim213 is offline Offline
40 posts
since Jun 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: pie Chart
Next Thread in PHP Forum Timeline: help me create datagrid via php and AJAX





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC