•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 423,607 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,231 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser: Programming Forums
Views: 863 | Replies: 0
![]() |
•
•
Join Date: Jul 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
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
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
![]() |
•
•
•
•
•
•
•
•
DaniWeb MS SQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- error '80020009' exception error (ASP)
- Replace repititious code with a loop? (Visual Basic 4 / 5 / 6)
- can i select the 2nd row/record from a table (MySQL)
- Print 5 records per table row (see script) (Perl)
- Loading and accessing 2 Dimensional tables (C++)
- gwt the record which match the current date (Visual Basic 4 / 5 / 6)
Other Threads in the MS SQL Forum
- Previous Thread: need query help
- Next Thread: Help with odd Query


Linear Mode