Jump to content
  • 0

Duplicating items in My SQL


Question

Posted (edited)

I was wondering if there's a way to duplicate all weapons and armor in MySQL (workbench) (I can't seem to copy columns and rows together). I know there are commands, but I'm not familiar with them. Maybe someone could type the command out for me or give me a list to get me started.

 

I'm looking for something that.. copies all columns where item type = 4 or 5 in item_db to item_db2

and another that.. renames rows 1st#-nth# to mth#-sth# (n,m,s are just arbitrary numbers; n<m<s  and  sth# - mth# = nth# - 1st#)

 

Thanks

Edited by Incognito

2 answers to this question

Recommended Posts

Posted

Oh, I wanted to rename the rows in a column.

 

Say we had the column `id`:

 

id   ->   id

1    ->   1

3    ->   2

5    ->   3

2    ->   4

7    ->   5

 

I just used...

 

SET @cnt = 25000;
UPDATE `ragnarok`.`item_db2`
SET `id` = @cnt := (@cnt + 1)
WHERE `id`= 4;

 

 

and thanks!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...