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
 Database Design and Application Architecture
 Design Problem: inflated records returned

Author  Topic 

jspaeth
Starting Member

1 Post

Posted - 2008-08-04 : 10:32:17
I have 4 tables that all have an OrderNum field in common. Having both detail tables in a query returns an inflated record set. The tables are:

ShipmentHdr
ShipmentDetail
OrderHdr
OrderDetail

The problem is having both detail tables included in a query while linking on the orderNum. These tables contain multiple duplicate orderNum entries since an order and a shipment can have multiple detail lines OrderNum entries. I need to pull info from both detail tables. Do I need to create a reference table?

ANY help would be appreciated.

Thanks

LoztInSpace
Aged Yak Warrior

940 Posts

Posted - 2008-08-05 : 08:50:44
Some table struture, sample data & expected output would help a lot here.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2008-08-05 : 10:14:51
Look up Cartesian product



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -