| | |
sql count total calls
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2008
Posts: 40
Reputation:
Solved Threads: 2
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
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

mysql Syntax (Toggle Plain Text)
SELECT destination, count(terminatecause) as tc CASE terminatecause WHEN 'ANSWER' THEN count(terminatecause) END as allcall FROM tblTable1 JOIN tblTable2on tblTable1.someID = tblTable2.someID JOIN tblTable3on tblTable2.someID1 = tblTable3.someID1 WHERE tblTable3.someID1= '1' AND tblTable1.someUser= 'user' AND tblTable1.callstarttime BETWEEN '2008-08-01 00:00:00' AND '2008-08-01 23:00:00' 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
![]() |
Similar Threads
- I lack focus... (Java)
Other Threads in the MySQL Forum
- Previous Thread: Counting MySQL connections on a page
- Next Thread: Inserting new row in mysql
| Thread Tools | Search this Thread |
agplv3 alfresco api artisticlicense aws bizspark breathalyzer camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright count court crm database design developer development distinct drupal dui ec2 email enterprise eudora facebook form foss gnu government gpl greenit groklaw groupware hiring hyperic images innerjoins insert ip joebrockmeier join journalism keyword keywords kickfire laptop law legal license licensing linux maintenance managing mariadb matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opengovernment opensource oracle penelope php query referencedesign reorderingcolumns resultset saas select sharepoint simpledb sourcecode spotify sql sugarcrm syntax techsupport thunderbird transparency virtualization





