Nissan 370Z Forum  

Set Theory + IT question

Give me some ideas IT guys. I'm stuck trying to figure this out on a Sunday!!! Given set A and set B where (A != B) Set A is given

Go Back   Nissan 370Z Forum > Nissan 370Z General Area > The Lounge (Off Topic)


Like Tree2Likes
  • 1 Post By 6MT
  • 1 Post By hansoac

 
 
LinkBack Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 01-27-2013, 04:55 PM   #1 (permalink)
Enthusiast Member
 
Join Date: Apr 2011
Location: Brooklyn Park, MN
Posts: 424
Drives: 04 se-r spec v, 370z
Rep Power: 14
homeryansta will become famous soon enough
Default Set Theory + IT question

Give me some ideas IT guys. I'm stuck trying to figure this out on a Sunday!!!

Given set A and set B where (A != B)

Set A is given in comma delimited form:
ID,Value
---------
1,1
1,2
2,2
3,1

Set B is given in comma delimited form:
ID,Value2
----------
1,1
1,3
1,4
2,2
3,1
3,2

I want the result set of A and B merged to look like this

ID,Value,Value2
------------------
1,1,1
1,2,3
1,null,4
2,2,2
3,1,1
3,null,2

Notice that I want to join the ID in the order they are displayed.
If I do a "full outer join" on the ID, I get 6 results for ID 1 which is not what I want.
If I do a union on both sets with dummy columns to match them up, I will still get 5 results for ID 1.

Any ideas? I can barely think anymore.



The IDs have to match, but doesn't cross match like in a traditional join.

Example:
if A has 3 rows with ID 1
and B has 1 row with ID 1

match the first row in A to the only row in B
and then just display the rest of A.

In a traditional join, all 3 rows in A would be join to the single row in B.
__________________
homeryansta is offline   Reply With Quote
 

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie Question... smart key question ellebycul New Forum Member 3 05-01-2011 05:04 PM


All times are GMT -5. The time now is 03:19 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.0 PL2