944,123 Members | Top Members by Rank

Ad:
  • MS SQL Discussion Thread
  • Unsolved
  • Views: 1510
  • MS SQL RSS
Jul 23rd, 2007
0

Repeated Row In Record Sets

Expand Post »
Hello All, first time post here and really stuck on this issue.

I have 4 Tables that i am Joining Across. Each one of the tables has around 800,000 Rows in it. I am Joining them all on a field Called MDRReport Key.

my query looks like this

SELECT Mdrfoit.MDRReportKey, Mdrfoit.DtReport, Mdrfoit.DateReceived, Mdrfoit.EventType, Mdrfoit.AdverseEvent, Mdrfoit.ProductProb, Mdrfoit.ReportOccup,DevTable.BrandName, DevTable.ManName, DevTable.ModelNumber, DevTable.ProductCode, DevTable.DeviceFamily, TextTable.Text

FROM Mdrfoit
INNER JOIN DevTable ON Mdrfoit.MDRReportKey = DevTable.MDRReportKey
INNER JOIN TextTable ON Mdrfoit.MDRReportKey = TextTable.MDRReportKey LEFT OUTER JOIN probLink ON Mdrfoit.MDRReportKey probLink.MDRReportKey

WHERE Mdrfoit.DateReceived BETWEEN '1/1/1995' AND '1/1/2007') AND
AND (DevTable.BrandName LIKE '&PLV%')

My problom is that when i do this i get back 3 rows in my result set for every 1 result that i want So ill get like

261568 1/24/2000 00:00.0 M N Y 114 PLV-100 RESPIRONICS, INC. 35001 CBK
261568 1/24/2000 00:00.0 M N Y 114 PLV-100 RESPIRONICS, INC. 35001 CBK
261568 1/24/2000 00:00.0 M N Y 114 PLV-100 RESPIRONICS, INC. 35001 CBK


So my result set is on average 3 time larger then its suppose to be, This is also causing my query time to be very very slow.

There are no Duplicate entries in the database where all of the fields are the same. I am confused on if this is a problom in my query. Any advice would be great
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
linkblaine is offline Offline
1 posts
since Jul 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MS SQL Forum Timeline: need query help
Next Thread in MS SQL Forum Timeline: Help with odd Query





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC