sql count total calls

Reply

Join Date: Jun 2008
Posts: 40
Reputation: enim213 is an unknown quantity at this point 
Solved Threads: 2
enim213 enim213 is offline Offline
Light Poster

sql count total calls

 
0
  #1
Nov 19th, 2008
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

  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 peter_budo; Nov 20th, 2008 at 8:23 am. Reason: corecting code, no spaces inside the tag
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the MySQL Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC