Update on more than one line

2

I'm trying to mount a update like this:

UPDATE cad_vendas SET canal ='9', parceiro ='9' 
WHERE cpf_vendedor ='CPF_VENDEDOR' and status_proposta_producao ='90'
and forma_pagamento <> '';

but it does not accept if I do not pass the id of the line and are several lines.

Does anyone have a solution where I can give uptade in N lines?

    
asked by anonymous 05.06.2017 / 15:25

1 answer

2

It does this for security, to prevent you from doing a wrong update on the whole bank, for example.

Add the key information he's requesting.

For example:

UPDATE cad_vendas SET canal ='9', parceiro ='9' 
WHERE cpf_vendedor ='CPF_VENDEDOR' and status_proposta_producao ='90'
and forma_pagamento <> '' and id > 10 and id < 30;

or

UPDATE cad_vendas SET canal ='9', parceiro ='9' 
WHERE cpf_vendedor ='CPF_VENDEDOR' and status_proposta_producao ='90'
and forma_pagamento <> '' and id in (10,20,30,40,50 )
    
05.06.2017 / 15:35