Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 problem in generating Query

Author  Topic 

aimt_rajiv
Starting Member

1 Post

Posted - 2010-10-06 : 09:05:21
i have a table having fields
callerid->person who making call.
personid->who receive the call.
calldetailid->foreignkey to calldetail table.
callcenterid->specifies id of the callcenter.
callcentername->callcenter name
AreaId->identify the Area/location of callcenter.
Areaname->name of the Area/location.
Callduration->duration of call in seconds.
iscall->identifies that callduration is a call like phone or mobile.
this contain value 1 if callduration is call else 0
ischat->identifies that callduration is duration of chat like gmail chat.this contain 1 if callduration is duration of chat otherwise 0.

callerid| personid| calldetailid| callcenterid| callcentername|
1 2 4 1 abc
2 2 5 1 abc
Areaid| areaname|callduration|iscall|ischat|
3 def 600 0 1---->this is chat
3 def 700 1 0---->this is call
i have to make the following query for .

|Avg |Avg |Total Duration|Total Duration
|Duration | Duration | (call) | (chat)
|(Call) | (Chat) | |
|in minutes| in minutes| |
----------------------------------------------------------------
Areaname1 | | | |
----------------------------------------------------------------
Centername1 | | | |
----------------------------------------------------------------
Centername2 | | | |
----------------------------------------------------------------
AreaName2
--------------------------------------------------------------
centername3
--------------------------------
centername4

Thanks
Rajiv Sharma

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2010-10-06 : 16:58:17
Thanks for trying to provide the details. Unfortunately what you posted is not clear.
Take a look at this hint for posting questions:

http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -