Reputation: 41
Lets take two result sets as in: 1,2,3,5,7
and 2,4,6,7,8
In the end I want 1,2,3,4,5,6,7,8
. I can not figure out how to code this in sql. Can any one give me some suggestions? I've seen some merging functions out there but having trouble implementing something simple.
Upvotes: 2
Views: 8478
Reputation: 141829
I think maybe you're thinking of UNION
?
If SELECT `Column` FROM `Table`
yields 1,2,3,5,7
And SELECT `Column` FROM `Table2`
yields 2,4,6,7,8
Then
SELECT `Column` FROM `Table`
UNION
SELECT `Column` FROM `Table2`
yields 1,2,3,4,5,6,7,8
Upvotes: 4