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.
| Author |
Topic |
|
batgrrrl
Starting Member
8 Posts |
Posted - 2001-11-05 : 20:09:34
|
| Hi Guys,Am after just a touch of help with some joins.TablesLines - (pk header_id, po_line_num)Header - (pk header_id)Invoices - (pk invoice_id - fk header_id)InvoiceLines - (pk invoice_id, invoice_line_num)Basically I want everything from the Lines table (that equals a set criteria)I want the records in the Header table that match the Lines.header_idI want the records in the Invoices table that match the Lines.header_idI want the records in the InvoiceLines table that match the Invoices.invoice_idWhat sort of joins should i use here. I've tried some basic ones but end up with 70 000 records when I should only end up with 3.I can get it working by selecting from the Lines table, then joining the Header table. But I dont know the right way to join the Invoices and InvoiceLines tables properly.If anyone can steer me in the right direction I would be very thankful :)Thanks for reading thisRenee :) |
|
|
|
|
|