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.
You may use UNION
(SELECT id FROM table1 WHERE 1=1)
UNION
(SELECT id FROM table2 WHERE 1=1)
ORDER BY id
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With