Help copy sql colume

Posted by jimmysback, 03-04-2010, 05:23 PM
Hi guys i need some help desining a sql query what i have is a table that has a few columes within the 1 table. the colume's are id, ulr and url2 now what i want to do is copy between row 100-200 from ulr to url 2. now the tricky bit is that the colume id is an auto incrementing so when i run the command shown blog.ekram.info/copy-data-from-one-column-to-another-column-in-mysql/ it seems to add as extra rows when it should be adding in the same row. i would appreciate if someone could help point me in the right direction better give me an example code. Thanks

Posted by mattle, 03-04-2010, 06:26 PM
That example is inserting data from one table into another. That's not what you want. I'm not going to write the SQL for you here (yeah, I'm one of those jerks that wants you to learn something...), however the format is pretty simple. Hey database I'd like to UPDATE column url2 to be EQUAL to column ulr WHERE column id is BETWEEN 100 AND 200

Posted by TheSimpleHost-Nathan, 03-04-2010, 08:32 PM
UPDATE table SET ulr2 = url WHERE id >= 100 AND id <= 200 Make sure you backup your database, don't trust me half asleep query

Was this answer helpful?

 Print this Article

Also Read

Need to run this shell file in the background every 10 secs

Posted by mikey1090, 03-19-2007, 04:44 PMThe following shell script (a php loop to run a file)...

2 questions about setting up domain registry on my site!

Posted by 21inchguns, 09-13-2001, 09:32 AMHi there, I just have two questions regarding setting...

I have a WHM/cPanel server shared server...

Posted by MightWeb-Greg, 04-21-2009, 06:45 PMI just had user KILL the server using 80% CPU and...

Where should i learn php/mysql?

Posted by mystycs, 03-04-2010, 04:11 PMDoes anyone know of good books or videos to learn...

problem with named

Posted by mohamed200, 09-15-2008, 12:46 PMhello , i have some problem with named when i moved...