You should be able to join the tables like this:

select p1.id /* and other cols */
from people1 p1
inner join people2 p2 on p1.Lname = p2.Lname and left(p1.Fname, 3) = 
left(p2.Fname, 3)
group by p1.id;

HTH, James Harvard

>I have two independently built tables of people.  I am trying to match people 
>from one with people from the other.  The problem is that in one table they 
>may have used "Ron" and in the other "Ronald".  What I want to do is have a 
>match if on something like "if 'Ronald" is like 'Ron%'  but obviously for any 
>name that could appear.  I know this won't help in cases like Bill and William 
>but it's better than nothing.  The first query below is the one I thought 
>would do the trick and the second one is setup for the specific case I know 
>exists to test the general idea.  The second one works but isn't very useful.  
>Can someone tell me how to make the first one work?
>The example I have has 'Ron' in the 'h' table and 'Ronald' in the 'm' table.  
>With a last name of Gibson.  In general the short name could be in either 
>table.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to