'Cross-product' and join question
- From: "wgblackmon@xxxxxxxxx" <wgblackmon@xxxxxxxxx>
- Date: 27 Mar 2006 10:47:19 -0800
Hi,
I'm designing a query with DBArtisan against a Sybase database. I'm not
a SQL guru but I can usually get the results I need given a good
understanding of the database and the relationships between tables.
However, this problem has me stumped. When I run the following query:
SELECT DISTINCT dbo.T_MULTILIST_GRADE.grade,
dbo.T_MULTILIST.code,
dbo.T_MULTILIST.description,
dbo.T_RECEIVING_DETAIL.amount,
dbo.T_ORDER.requisition_time_stamp,
dbo.T_REQUISITION.id,
dbo.T_DEPOSITORY.depository_type,
dbo.T_REQUISITION_DETAIL.quantity,
dbo.T_RECEIVING_DETAIL.invoice_number,
dbo.T_RECEIVING.status
FROM dbo.T_MULTILIST, dbo.T_MULTILIST_GRADE, dbo.T_REQUISITION,
dbo.T_REQUISITION_DETAIL, dbo.T_ORDER, dbo.T_DEPOSITORY,
dbo.T_RECEIVING_DETAIL, dbo.T_RECEIVING
WHERE (dbo.T_RECEIVING_DETAIL.invoice_number =
dbo.T_RECEIVING.invoice_number AND
dbo.T_RECEIVING_DETAIL.order_id = dbo.T_ORDER.id AND
dbo.T_ORDER.depository_id = dbo.T_DEPOSITORY.id AND
dbo.T_REQUISITION.id = dbo.T_ORDER.requisition_id AND
dbo.T_REQUISITION_DETAIL.requisition_id = dbo.T_REQUISITION.id AND
dbo.T_REQUISITION_DETAIL.multilist_code =
dbo.T_MULTILIST_GRADE.multilist_code AND
dbo.T_MULTILIST_GRADE.multilist_code = dbo.T_MULTILIST.code)
I receive the following 'Warning' from DBArtisan:
'Warning: Table T_RECEIVING_DETAIL is not involved in the join and will
result in the generation of a cross product'
I also get duplicate records, the result of the cross-product. I don't
understand why T_RECEIVING_DETAIL is 'not involved in the join',
however. The data model in this database leaves a lot to be desired.
Any advice would be greatly appreciated.
Thanks,
Bill
.
- Follow-Ups:
- Re: 'Cross-product' and join question
- From: --CELKO--
- Re: 'Cross-product' and join question
- From: Mark A. Parsons
- Re: 'Cross-product' and join question
- Prev by Date: 64bit Client software for Windows
- Next by Date: Re: 'Cross-product' and join question
- Previous by thread: 64bit Client software for Windows
- Next by thread: Re: 'Cross-product' and join question
- Index(es):
Relevant Pages
|