3
I have the following database:
cd_telefone|cd_cliente |nr_ddd |nr_telefone 1 | 30 | 11 |2562-2791 2 | 30 | 11 |2562-2791 3 | 31 | 13 |8888-8888 4 | 30 | 11 |5555-5555 5 | 30 | 13 |9623-54002 6 | 30 | 11 |1111-2525
My intention is to pass the value of ddd and phone, and return cd_phone, and from cd_phone, update the existing number.
My Code is so, not error, but does not work:
UPDATE tb_telefones SET nr_ddd='" + dddNovo + "', nr_telefone='" + telNovo+ "' WHERE cd_telefone = ( SELECT cd_telefone FROM tb_telefones WHERE nr_ddd='" + dddAntigo + "' AND nr_telefone='" + telAntigo + "' )
What database are you using? SQL Server / Oracle?
– Tiedt Tech
In fact it is access.
– Eduardo F. Santos