Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Performing an In statement between two datasets Expand / Collapse
Author
Message
Posted Tuesday, April 16, 2013 12:34 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, August 26, 2014 5:15 AM
Points: 99, Visits: 304
I have two oledbsources. One oledbsource has the distinct list of product ids (DataSet A) and another oledbsource has all of the order information with product id (DataSet B). How do I get all those orders (DataSet B) that have product ids in DataSet A?
For example:

Dataset A
product id
1
2


Dataset B
order id product id
1 1
2 1
3 1


the result set should be
order id product id (DataSet A)
1 1
2 1
3 1

The Merge join transformation didn't give the desired results.
Post #1442939
Posted Tuesday, April 16, 2013 1:20 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 6:25 AM
Points: 1,909, Visits: 19,099
rs80 (4/16/2013)
I have two oledbsources. One oledbsource has the distinct list of product ids (DataSet A) and another oledbsource has all of the order information with product id (DataSet B). How do I get all those orders (DataSet B) that have product ids in DataSet A?
For example:

Dataset A
order id product id
1 1
2 1
3 1


Dataset B
product id
1
2

the result set should be
order id product id (DataSet B)
1 1
2 1
3 1

The Merge join transformation didn't give the desired results.



join the two tables on productId?

ps...are you sure your explanation of which data set is which is correct?


______________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
Post #1442970
Posted Tuesday, April 16, 2013 2:12 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, August 26, 2014 5:15 AM
Points: 99, Visits: 304
You were right. The datasets were referred incorrectly.

In the merge join transformation, when I do an inner join I only get 1 record back. However, when I do a t-sql query I get all 3 records back.
Post #1443003
Posted Tuesday, April 16, 2013 2:18 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 6:25 AM
Points: 1,909, Visits: 19,099
rs80 (4/16/2013)
You were right. The datasets were referred incorrectly.

In the merge join transformation, when I do an inner join I only get 1 record back. However, when I do a t-sql query I get all 3 records back.


care to share your code?


______________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
Post #1443006
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse