mysql - join tables by unique field

Posted by Qiao on Stack Overflow See other posts from Stack Overflow or by Qiao
Published on 2010-03-24T16:20:39Z Indexed on 2010/03/24 16:23 UTC
Read the original article Hit count: 315

Filed under:
|

I have two tables with the same structure:

id name
1 Merry
2 Mike

and

id name
1 Mike
2 Alis

I need to join second table to first with keeping unique names, so that result is:

id name
1 Merry
2 Mike
3 Alis

Is it possible to do this with MySQL query, without using php script?

© Stack Overflow or respective owner

Related posts about mysql

Related posts about sql