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