MySQL Forums
Forum List  »  General

Re: JOIN BETWEEN 2 TABLES WITH DIFFERENT ID COUNTING
Posted by: Peter Brawley
Date: November 28, 2015 11:12AM

drop table if exists b,a;
create table a( id smallint, name varchar(255) );
create table b like a;
insert into a values(1,'al'),(2,'bob');
insert into b values(3,'chuck'),(4,'al');
select a.id from a join b using (name);
+------+
| id   |
+------+
|    1 |
+------+

Options: ReplyQuote


Subject
Written By
Posted
Re: JOIN BETWEEN 2 TABLES WITH DIFFERENT ID COUNTING
November 28, 2015 11:12AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.