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.
| Author |
Topic |
|
johnn_king
Starting Member
2 Posts |
Posted - 2005-09-07 : 02:20:02
|
| Hi All,Would be great if someone can help me with this query.I have the following tables1.<email_tracking>assign_agent transfer_agent replied_agent ================================================henrychua ut23sorter henrychua ut23sorter ut23tester09 ut23sorter ut23tester09 <null> <null> 2. <agent_name>agent_id============henrychuaut23sorterut23tester09Now with these tow table is I am trying to get this outputAgentNAme Assigned Replied Transferred=============================================================henrychua 1 1 1ut23sorter 1 1 0ut23tester09 1 0 1How can I achieve the above output? can some help me with the queryI wrote this query to get the assigned and repliedselect email_tracking.assign_agent As AgentName,count(email_tracking.assign_agent) As Assigned,count(email_tracking.replied_agent) As Repliedfrom email_tracking,agent_name where email_tracking.assign_agent=agent_name.agent_id group by email_tracking.assign_agent order by email_tracking.assign_agent ascI am having trouble getting the transferred count.can someone plz help! |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-09-07 : 03:17:18
|
| Hi Johnn_King, how did you come up with the numbers?It'll be easier to help you if you can provide that info--------------------keeping it simple... |
 |
|
|
johnn_king
Starting Member
2 Posts |
Posted - 2005-09-07 : 03:59:28
|
| I was trying to give an example.My requirment is I need to get the details of1.agent_name2.no.of emails assigned to him3.no.of emails replied by him4.no.of transfer made by himthe above nee dto be done using the tables <email_tracking> and <agent_name>I am able to get the assigned and replied count. But I am not able to get the transfer name using the same query (the transfer name is always different from the assign name). |
 |
|
|
|
|
|