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
 New to SQL Server Programming
 Help me write my query? Please?

Author  Topic 

blandow
Starting Member

6 Posts

Posted - 2011-06-20 : 17:44:13
I have 3 tables that I am working with:

distribution_stop_information
distribution_line_items
distribution_scan_item scans

I need to write a query that returns

item#(from line_items)
BOL# (from stop_information)
Zip (from stop_information)
scan type(from item_scans) (there are 3 types: 1,2,9)
scan time(from item_scans)

I've been crashing and burning...not too good at joins..
Anyone up for the challenge?
Thanks in advance

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-06-20 : 18:25:22
What links the 3 tables together? Also, is item# a column in your table, or do you want a count of items.

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-06-20 : 18:25:23
What links the 3 tables together? Also, is item# a column in your table, or do you want a count of items.

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

blandow
Starting Member

6 Posts

Posted - 2011-06-21 : 04:34:15
Sorry - forgot to mention each table has the field 'unique_id' which is the link.
And I am wanting to return the data in the previously mentioned fields where company_no = 7808

thanks
Go to Top of Page

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2011-06-21 : 11:14:53
ok -- and which table does the company_no column live on?

Stop and read your question and then think : knowing nothing else could I even start to answer this question?

Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page
   

- Advertisement -