Re: sql to duplicate records with modified value

2010-04-27 Thread Voytek Eymont
thanks, Ray, that worked well (btw, you have a typo, 'Independant' instead of 'Independent') btw2, I have a pdf with some 15,000 names that I would like to display with a search function, I email you later, maybe you can help me with that -- Voytek > Hi Voytek > > > You could try some vari

Re: sql to duplicate records with modified value

2010-03-27 Thread Ray Cauchi
Hi Voytek You could try some variation of: INSERT INTO inserttable (user, maildir) SELECT REPLACE(user, '@', 'spam@') as user, CONCAT(maildir,'.spam/') as maildir FROM selecttable [WHERE ..] the where bit is optional of course! let me know how you go - hope you are keeping well! ray At 03

Re: sql to duplicate records with modified value

2010-03-27 Thread Voytek Eymont
> Voytek Eymont wrote: > Are you hoping to do all that you want - copy rows, update rows and > create new rows - in a single SQL statement? Because if that's what you > want, I don't think it's possible. Unless someone has come up with some > new tricks, you can't insert a new record and update

Re: sql to duplicate records with modified value

2010-03-27 Thread Rhino
Voytek Eymont wrote: I have Postfix virtual mailboxes in MySQL table like below: I'd like to duplicate all records whilst MODIFYING two fields like so: current record has format like: user 'usern...@domain.tld' maildir 'domain.tld/usern...@domain.tld/' add new record that has: user 'username

sql to duplicate records with modified value

2010-03-26 Thread Voytek Eymont
I have Postfix virtual mailboxes in MySQL table like below: I'd like to duplicate all records whilst MODIFYING two fields like so: current record has format like: user 'usern...@domain.tld' maildir 'domain.tld/usern...@domain.tld/' add new record that has: user 'username+s...@domain.tld' maildir