How can I add new rows with mulitiple columns?

Enferno's profile image Enferno posted 9 months ago in General Permalink

I've looked under "UPDATE" and "CREATE" but I cannot figure out how to actually add new rows with multiple columns. I'll give some examples of what I'm looking for ..

The actual table reads:

#     |skillID|class|level|cap|class_
1        30      8     1    5    0
2        30      8     2    10   0
3        30      8     3    15   0
4        30      8     4    20   0
5        30      8     5    25   0

All the way to 100 total lines for the same skillID/class. I want to add 100 lines with the same classID / class but change the level on each row and cap.

I can change the hotkey of duping rows and do it one row at a time but it takes hours to add 70+ skills.

Does anyone have any idea how to do this using query?

Enferno's profile image Enferno posted 9 months ago Permalink

It messed up how I had the table listed, so I'll put up a screenshot of the actual table.

I want to only change the level and cap columns to add 100 new lines.

1 attachment(s):
  • heidisql_table
Enferno's profile image Enferno posted 9 months ago Permalink

Ok, I see where this is posted when I add a new row:

INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 55, 275);
SELECT `skillID`, `class`, `level`, `cap`, `class_` FROM `peq`.`skill_caps` WHERE  `skillID`=32 AND `class`=8 AND `level`=55 AND `class_`=0;

Can I use this in a query to create 100 new rows and only change the level and cap per line?

Enferno's profile image Enferno posted 9 months ago Permalink

Ok, so I managed to do this:

INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 1, 5);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 2, 10);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 3, 15);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 4, 20);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 5, 25);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 6, 30);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 7, 35);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 8, 40);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 9, 45);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 10, 50);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 11, 55);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 12, 60);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 13, 65);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 14, 70);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 15, 75);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 16, 80);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 17, 85);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 18, 90);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 19, 95);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 20, 100);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 21, 105);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 22, 110);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 23, 115);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 24, 120);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 25, 125);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 26, 130);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 27, 135);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 28, 140);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 29, 145);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 30, 150);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 31, 155);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 32, 160);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 33, 165);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 34, 170);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 35, 175);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 36, 180);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 37, 185);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 38, 190);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 39, 195);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 40, 200);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 41, 205);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 42, 210);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 43, 215);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 44, 220);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 45, 225);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 46, 230);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 47, 235);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 48, 240);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 49, 245);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 50, 250);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 51, 255);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 52, 260);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 53, 265);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 54, 270);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 55, 275);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 56, 280);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 57, 285);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 58, 290);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 59, 295);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 60, 300);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 61, 305);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 62, 310);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 63, 315);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 64, 320);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 65, 325);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 66, 330);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 67, 335);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 68, 340);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 69, 345);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 70, 350);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 71, 355);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 72, 360);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 73, 365);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 74, 370);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 75, 375);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 76, 380);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 77, 385);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 78, 390);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 79, 395);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 80, 400);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 81, 405);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 82, 410);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 83, 415);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 84, 420);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 85, 425);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 86, 430);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 87, 435);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 88, 440);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 89, 445);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 90, 450);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 91, 455);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 92, 460);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 93, 465);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 94, 470);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 95, 475);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 96, 480);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 97, 485);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 98, 490);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 99, 495);
INSERT INTO `peq`.`skill_caps` (`skillID`, `class`, `level`, `cap`) VALUES (32, 8, 100, 500);

Would there be an shorter way to do this or would this be the only way to add 100 new lines?

Enferno's profile image Enferno posted 9 months ago Permalink

Also, is there a way to update a line no matter what the value is? Example: If I want to update a line with a value of "0", "5", "10" and "20" is there a formula to change them all to "99" at the same time? value= 'xx' or something?

Enferno's profile image Enferno posted 9 months ago Permalink

^^ I said that incorrectly, what I mean is sometimes the value is 0, sometimes it's 4, sometimes it's 5, sometimes 10, sometimes 200, etc... Can I make a line in SQL to read the value no matter what it is and change it to what I want?

ansgar's profile image ansgar posted 9 months ago Permalink

Many questions here.

Multiple lines can also be inserted with the extended INSERT syntax:

INSERT INTO mytable (col1, col2, col3)
    VALUES (1, 1, 1),
           (2, 2, 2),
           (3, 3, 3);

Updating all columns of one row needs a primary key in the underlying table, which you then use in an UPDATE ... WHERE ... query:

UPDATE mytable SET col1=99, col2=99, col3=99 WHERE prikey_col=123;
Enferno's profile image Enferno posted 9 months ago Permalink

Many questions here.

Multiple lines can also be inserted with the extended INSERT syntax:

INSERT INTO mytable (col1, col2, col3)
    VALUES (1, 1, 1),
           (2, 2, 2),
           (3, 3, 3);

Updating all columns of one row needs a primary key in the underlying table, which you then use in an UPDATE ... WHERE ... query:

UPDATE mytable SET col1=99, col2=99, col3=99 WHERE prikey_col=123;

Sorry, I was figuring out things myself after posting here and then running into new problems along the way and I don't see a way to "edit" what I've posted so I had to keep posting new things.

First of all, thank you for the time and answer(s)!! Where you have "col1", "col2", "col3", etc. I'm assuming I have to put the name of each column and not just "col1", "col2", "col3", etc... correct?

Also, what if say "col1" has a different value on this table and another value on the next table and another value on a third table and so on... is there a way to change all of these values to what I want (say 100) using the same line or would I have to actually make a line for each value?

col1 = 50 on table 1, col1 = 100 on table 2, col1 = 150 on table 3 and so on...

Enferno's profile image Enferno posted 9 months ago Permalink

Could I use something like:

UPDATE peq.skill_caps SET skillID = '33' AND class = '8' AND level = '41' AND cap = '205' WHERE skillID = '33' AND class = '8' AND level = '41' AND cap = '';

Then put 0-1000 on cap = 'here' to make it read any value between 0 and 1000? Is it possible to read between certain values?

Enferno's profile image Enferno posted 9 months ago Permalink

Ok, so I put this:

UPDATE peq.skill_caps SET skillID = '33' AND class = '8' AND level = '41' AND cap = '205' WHERE skillID = '33' AND class = '8' AND level = '41' AND 'cap' BETWEEN '0' AND '1000';

It seemed to have no errors, but nothing happened... am I even close?

ansgar's profile image ansgar posted 9 months ago Permalink

Yes, with "colX" I am referring to the name of your "Column X".

You can update all rows in a table when you leave the WHERE clause away:

UPDATE mytable SET col1=123, col2=456;

But be aware this updates all rows in your table.

Enferno's profile image Enferno posted 9 months ago Permalink

Yes, with "colX" I am referring to the name of your "Column X".

You can update all rows in a table when you leave the WHERE clause away:

UPDATE mytable SET col1=123, col2=456;

Aye, I can update all tables or all rows easily, but I cannot figure out how to update them if they're different. Let me explain:

They're a total of 16 classes in EverQuest. They are a total of 77 skills. With that said, Class 1 / Skill 1 might be 0. Class 2 / Skill 1 might be 5. Class 3 / Skill 1 might be 10. Class 4 / Skill 1 might be 15 and so on. So, I cannot just change the class and the same line work, I have to actually find the exact value and alter the entire query on each class.

I was just wanting to be able to change the class and have it change the value of whichever one I'm altering at the time no matter what the skill value is.

UPDATE peq.skill_caps SET skillID = '33' AND class = '8' AND level = '41' AND cap = '205' WHERE skillID = '33' AND class = '8' AND level = '41' AND cap = '';

^ This line works, however I do have to know the EXACT value of cap each time, now imagine 100 lines (each level from 1-100) and 77 skills. I mean if I have to actually modify every line each time, what is the point?

I just delete all 100 lines of the skill and use this (Below) to re-enter it each time, it's much easier and faster than trying to UPDATE what is already there, unless they were a way to do it no matter what value cap is.

INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 1, 5); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 2, 10); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 3, 15); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 4, 20); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 5, 25); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 6, 30); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 7, 35); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 8, 40); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 9, 45); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 10, 50); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 11, 55); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 12, 60); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 13, 65); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 14, 70); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 15, 75); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 16, 80); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 17, 85); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 18, 90); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 19, 95); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 20, 100); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 21, 105); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 22, 110); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 23, 115); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 24, 120); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 25, 125); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 26, 130); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 27, 135); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 28, 140); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 29, 145); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 30, 150); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 31, 155); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 32, 160); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 33, 165); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 34, 170); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 35, 175); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 36, 180); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 37, 185); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 38, 190); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 39, 195); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 40, 200); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 41, 205); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 42, 210); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 43, 215); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 44, 220); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 45, 225); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 46, 230); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 47, 235); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 48, 240); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 49, 245); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 50, 250); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 51, 255); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 52, 260); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 53, 265); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 54, 270); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 55, 275); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 56, 280); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 57, 285); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 58, 290); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 59, 295); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 60, 300); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 61, 305); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 62, 310); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 63, 315); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 64, 320); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 65, 325); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 66, 330); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 67, 335); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 68, 340); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 69, 345); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 70, 350); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 71, 355); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 72, 360); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 73, 365); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 74, 370); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 75, 375); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 76, 380); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 77, 385); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 78, 390); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 79, 395); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 80, 400); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 81, 405); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 82, 410); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 83, 415); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 84, 420); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 85, 425); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 86, 430); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 87, 435); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 88, 440); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 89, 445); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 90, 450); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 91, 455); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 92, 460); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 93, 465); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 94, 470); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 95, 475); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 96, 480); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 97, 485); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 98, 490); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 99, 495); INSERT INTO peq.skill_caps (skillID, class, level, cap) VALUES (32, 8, 100, 500);

This will input the skill I want just by changing the skillID (0-77) and class (1-16).

But be aware this updates all rows in your table.

Enferno's profile image Enferno posted 9 months ago Permalink

I guess I should ask if using:

UPDATE peq.skill_caps SET skillID = '33' AND class = '8' AND level = '41' AND cap = '205' WHERE skillID = '33' AND class = '8' AND level = '41' AND cap = 'XXXX';

Can it find the value listed in this line above as "XXXX" no matter what the value is in the table? Is there a formula to find any value no matter what it may be?

Enferno's profile image Enferno posted 7 months ago Permalink

UPDATEpeq.skill_capsSET skillID = '0' AND class = '1' AND level = '1' AND cap = '5' WHERE skillID = '0' AND class = '1' AND level = '1' AND cap MIN '0' to MAX '999';

How can I correct the last part of this line, please? I need this to read the very last part "cap = from 1-999" or whatever would be the correct way to do this, is this possible?

That number can be anything from 0 to 999, I have no idea how to do this without having to manually type in the exact number each time. I'm doing this on 100 lines each time, so I don't want to have to type the actual number each line and every time that I want to do a query.

Enferno's profile image Enferno posted 7 months ago Permalink

*** Sorry, I don't see where to edit :(

Can I use < or > or - or + instead of = ?

Enferno's profile image Enferno posted 7 months ago Permalink

Ok, so I've managed to learn a few new things, however I cannot get them to work...

UPDATEpeq.skill_capsSET skillID = '0' AND class = '1' AND level = '1' AND cap = '5' WHERE skillID = '0' AND class = '1' AND level = '1' AND cap BETWEEN 0 AND 999;

No errors, but it doesn't update the table, any reason why? (sorry, I wish this forum had an edit so I didn't have to keep posting as I find things) = I'm trying to learn this and not just sit around waiting for someone to do it for me...

Enferno's profile image Enferno posted 7 months ago Permalink

Ok, I figured it out for anyone that ever needs or reads this:

You must only put what you're changing after SET and nothing else.

Example(s):

This is what I had: UPDATE peq.skill_caps SET skillID = 0 AND class = 1 AND level = 7 AND cap = 35 WHERE skillID = 0 AND class = 1 AND level = 7 AND cap BETWEEN 0 AND 999;

But it won't work, you have to take out what isn't changing and end up like this:

UPDATE peq.skill_caps SET cap = 35 WHERE skillID = 0 AND class = 1 AND level = 7 AND cap BETWEEN 0 AND 999;

See how I deleted everything that wasn't actually updating? The only thing I wanted to change was the cap. So, it works now :)

Please login to leave a reply, or register at first.