Valterlane Posted January 29, 2022 Report Share Posted January 29, 2022 Boa noite, estou querendo mudar duas propriedade em uma única linha usando update. Assim: UPDATE PRODUTO SET PRODES='TESTE 1 CONCLUIDO, TESTE 2 CONCLUIDO' WHERE PROCOD=1,2 PROCOD - É UMA IDENTIDADE DE CADA UM 1 E 2 É UMA PRODUTO DIFERENTE. PRODES - É O NOME QUE COMPOE O CAMPO QUERO ALTERAR O PRODUTO 1 E 2 UTILIZANDO A MESMA LINHA DE UPDATE, É PQ IREI TER QUE FAZER ISSO EM VARIOS PRODUTOS AQUI. DA MANEIRA UPDATE 1 PO 1 DEMORA MUITO. Quote Link to comment Share on other sites More sharing options...
Valterlane Posted January 29, 2022 Author Report Share Posted January 29, 2022 Quote Link to comment Share on other sites More sharing options...
ADutheil Posted January 30, 2022 Report Share Posted January 30, 2022 Tente algo tipo UPDATE produto SET prodes = prodes + ' CONCLUIDO' WHERE procod in (1, 2); Quote Link to comment Share on other sites More sharing options...
Valterlane Posted January 30, 2022 Author Report Share Posted January 30, 2022 1 hora atrás, ADutheil disse: Tente algo tipo UPDATE produto SET prodes = prodes + ' CONCLUIDO' WHERE procod in (1, 2); Então é assim, Update produto set Prodes='teste 1 concluído, teste 2 concluído' where procod=1,2 são dois códigos. Quero que o produto 1 mude o nome para teste 1 concluído e o teste 2 concluído vá para o produto 2. mas ambos acabam ficando como "teste 1 concluído, teste 2 concluído." Quote Link to comment Share on other sites More sharing options...
ADutheil Posted January 31, 2022 Report Share Posted January 31, 2022 É o resultado do comando que enviou: Prodes='teste 1 concluído, teste 2 concluído' . O que acontece se vc manda prodes = prodes + ' CONCLUIDO' ? Quote Link to comment Share on other sites More sharing options...
emotta Posted January 31, 2022 Report Share Posted January 31, 2022 Em 29/01/2022 at 00:41, Valterlane disse: Boa noite, estou querendo mudar duas propriedade em uma única linha usando update. Assim: UPDATE PRODUTO SET PRODES='TESTE 1 CONCLUIDO, TESTE 2 CONCLUIDO' WHERE PROCOD=1,2 PROCOD - É UMA IDENTIDADE DE CADA UM 1 E 2 É UMA PRODUTO DIFERENTE. PRODES - É O NOME QUE COMPOE O CAMPO QUERO ALTERAR O PRODUTO 1 E 2 UTILIZANDO A MESMA LINHA DE UPDATE, É PQ IREI TER QUE FAZER ISSO EM VARIOS PRODUTOS AQUI. DA MANEIRA UPDATE 1 PO 1 DEMORA MUITO. vc está usando SQLRDD? Quote Link to comment Share on other sites More sharing options...
ADutheil Posted January 31, 2022 Report Share Posted January 31, 2022 Testei aqui e funciona sem problema: UPDATE produto SET prodes = CONCAT( prodes, ' CONCLUIDO' ) WHERE procod in (1, 2); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.