[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql
Subject:    Re: Replace on Join
From:       Peter Brawley <peter.brawley () earthlink ! net>
Date:       2007-10-30 1:03:50
Message-ID: 472682F6.2040103 () earthlink ! net
[Download RAW message or body]


How about this ...

update schedule s
join directory d on s.email = replace(d.email, '@wnc.edu', '@wncc.edu')
set s.email=replace(s.email, '@wncc.edu', '@wnc.edu' );

PB

-----

Kevin Murphy wrote:
> I'm trying to do a join on two pieces of data that are not quite 
> exactly the same. Basic story, I have 2 tables (output from 2 
> mainframes) in MySQL where one table has our email addresses as 
> @wncc.edu (our old name) and the other has it as @wnc.edu (our new 
> name). So here is an abbreviated version of the query that is trying 
> to match them, and it doesn't work. Any suggestions?
>
> SELECT * FROM schedule
> LEFT JOIN directory ON
> (    REPLACE('@wncc.edu','@wnc.edu',schedule.email) = 
> directory.email    )
>
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.503 / Virus Database: 269.15.11/1094 - Release Date: 10/26/2007 8:50 AM
>   


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic