Ir para conteúdo
  • 0

Comando SQL trocar todos vocação x pra vocação y


warriorfrog

Pergunta

Então gente criei umas vocações, mas ninguem gostou no meu OT, quero troca-las de volta pras originais do tibia, exemplo lá tem 9- Orc Sorcerer queria que todos da vocação 9 volta-sem pra vocação 1 que no caso é human sorcerer, alguem sabe me dizer o comando que faz isso?

Link para o comentário
Compartilhar em outros sites

6 respostass a esta questão

Posts Recomendados

  • 0

UPDATE players SET vocation = 1 WHERE vocation = 2

 

Nesse exemplo, todos os jogadores com vocação número 2 vão passar a ser vocação número 1.

Link para o comentário
Compartilhar em outros sites

  • 0

UPDATE players SET vocation = 1 WHERE vocation = 2

 

Nesse exemplo, todos os jogadores com vocação número 2 vão passar a ser vocação número 1.

 

Tentei assim:

 

UPDATE players SET vocation = 1 WHERE vocation = 9

UPDATE players SET vocation = 1 WHERE vocation = 17

UPDATE players SET vocation = 1 WHERE vocation = 25

UPDATE players SET vocation = 2 WHERE vocation = 10

UPDATE players SET vocation = 2 WHERE vocation = 18

UPDATE players SET vocation = 2 WHERE vocation = 26

UPDATE players SET vocation = 3 WHERE vocation = 11

UPDATE players SET vocation = 3 WHERE vocation = 19

UPDATE players SET vocation = 3 WHERE vocation = 27

UPDATE players SET vocation = 4 WHERE vocation = 12

UPDATE players SET vocation = 4 WHERE vocation = 20

UPDATE players SET vocation = 4 WHERE vocation = 28

 

Deu esses erros:

 

Error

SQL query:

UPDATE players SET vocation =1 WHERE vocation =9 UPDATE players SET vocation =1 WHERE vocation =17 UPDATE players SET vocation =1 WHERE vocation =25 UPDATE players SET vocation =2 WHERE vocation =10 UPDATE players SET vocation =2 WHERE vocation =18 UPDATE players SET vocation =2 WHERE vocation =26 UPDATE players SET vocation =3 WHERE vocation =11 UPDATE players SET vocation =3 WHERE vocation =19 UPDATE players SET vocation =3 WHERE vocation =27 UPDATE players SET vocation =4 WHERE vocation =12 UPDATE players SET vocation =4 WHERE vocation =20 UPDATE players SET vocation =4 WHERE vocation =28

MySQL said: b_help.png

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPDATE players SET vocation = 1 WHERE vocation = 17

UPDATE players SET vocation' at line 2

Link para o comentário
Compartilhar em outros sites

  • 0

 

UPDATE players SET vocation = 1 WHERE vocation = 9;
UPDATE players SET vocation = 1 WHERE vocation = 17;
UPDATE players SET vocation = 1 WHERE vocation = 25;
UPDATE players SET vocation = 2 WHERE vocation = 10;
UPDATE players SET vocation = 2 WHERE vocation = 18;
UPDATE players SET vocation = 2 WHERE vocation = 26;
UPDATE players SET vocation = 3 WHERE vocation = 11;
UPDATE players SET vocation = 3 WHERE vocation = 19;
UPDATE players SET vocation = 3 WHERE vocation = 27;
UPDATE players SET vocation = 4 WHERE vocation = 12;
UPDATE players SET vocation = 4 WHERE vocation = 20;
UPDATE players SET vocation = 4 WHERE vocation = 28;
Link para o comentário
Compartilhar em outros sites

  • 0
UPDATE players SET vocation = 1 WHERE vocation = 9;
UPDATE players SET vocation = 1 WHERE vocation = 17;
UPDATE players SET vocation = 1 WHERE vocation = 25;
UPDATE players SET vocation = 2 WHERE vocation = 10;
UPDATE players SET vocation = 2 WHERE vocation = 18;
UPDATE players SET vocation = 2 WHERE vocation = 26;
UPDATE players SET vocation = 3 WHERE vocation = 11;
UPDATE players SET vocation = 3 WHERE vocation = 19;
UPDATE players SET vocation = 3 WHERE vocation = 27;
UPDATE players SET vocation = 4 WHERE vocation = 12;
UPDATE players SET vocation = 4 WHERE vocation = 20;
UPDATE players SET vocation = 4 WHERE vocation = 28;

 

 

Hm precisava de ;

Obrigado ai vcs reputado os dois

 

---

crl vodkart me ajuda em todas ;O

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...