MYSQL - Adding result set A to result set B? Please see my example
- by BlackberryFan
I have two mysql tables.
They are laid out in this manner:
user_info
id | emailContact
_______________________
1 | person@example.com
3 | anotherPerson@example.com
user_biz_info
id | emailContact
_________________________
8 | business@example.com
9 | anotherBusiness@example.com
What kind of join would I use to create a result set of information like this:
id | emailContact
________________________________
1 - person@example.com
3 - anotherPerson@example.com
8 - business@example.com
9 - anotherBusiness@example.com
I have tried the following:
SELECT p.id, p.emailContact, b.id, b.emailContact
FROM user_info p, user_business_info b
But it seems that this is an incorrect approach.
Would someone be able to suggest the correct approach in this or possibly point me in the direction of some tutorials that cover this type of mysql join, as this is what I assume is needed in this case.
Thanks for your time in reading through my question!!