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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Join problem.

Author  Topic 

Firemaple
Starting Member

14 Posts

Posted - 2007-11-05 : 14:03:51
Hey all, I run the following statement and get odd results. There are no duplicates in "callnumber" in either table, but the results give me duplicate entries. Any ideas?

SQL:

select b.agentid, a.submitTime,a.callNum,a.[Description],b.email as "Users Email",
a.Resolved, a.TimesCalled, a.OverallSat,a.Question1,a.Question2,a.Question3,a.Question4,a.Question5
from tblSurveyssent b
inner join tblSurveyResults a
on (a.callNum = b.callNumber)

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-11-05 : 14:10:53
Providing sample data that illustrates what you have in the tables plus showing us what your query is returning is always helpful. We can't see your environment, so you must help us "see" it.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-11-05 : 14:12:13
So, what you are saying is that

select count(*), count(distinct callnum) from tblsurveyresults

gives two identical numbers? And

select count(*), count(distinct callnumber) from tblsurveyssent

also returns two identical numbers?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -