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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Unusual JOIN

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-05-22 : 09:17:31
Chris Mibus writes "I have 2 tables.

The 1st contains a list of products.

The 2nd contains a field that is a reference to the other table and has the date and store purchased from.

I need to return 1 table that has all of the fields from the first table and then also has JOINed to it the last location and date that the item was purchased from.

IE.

Table 1:

ID Item Color Size
1 underwear blue small
2 pants blue small
3 underwear blue small

Table 2:

ID Date Location
1 5/15/01 Dillards
1 5/01/01 Dillards
1 5/03/01 Sears
2 5/15/01 Dillards
2 5/19/01 Dillards
2 5/24/01 Foleys
3 5/12/01 Dillards
3 5/15/01 Dillards
1 5/10/01 Dillards

I'm looking to get a table with the following information:

ID Item Color Size Date Location
1 underwear blue small 5/15/01 Dillards
2 pants blue small 5/19/01 Dillards
3 underwear blue small 5/24/01 Foleys


Keep in mind both tables have alot more fields as well as have many hundreds of records in them. Is this possible?"
   

- Advertisement -