Questions tagged as 'sql-update'

4
answers

How do I insert a value into every record in a column of a table?

I have the 'category' table and an 'id' column, with more than 100 records in that column. How do I add a value to all of these records? In case the value would be '3'.     
asked by 24.07.2017 / 18:48
3
answers

How to go through each row in the database compare and update a specific column?

I have a table named PRODUCT and I need to make a comparison between two columns, the column DATA_INICIAL AND DATA_FINAL , for each line covered, if the product does not agree enter the value 0 in the PROD_ATIVO column. Rule: If...
asked by 27.03.2017 / 20:53
2
answers

No select error with PHP + MySQLi

I'm trying to use a query to pull a specific ID from another page. I can get ID through $_GET , I printed the query to see if it was right, even though it did not show me what error it was. Code: <?php $mys...
asked by 31.05.2016 / 06:21
1
answer

Remove spaces via Update

I have a field called titulo , in the noticias table. Unfortunately, due to forgetting PHP's trim command, it has several titles with space at the beginning and end of the string . How can I via SQL (MySQL) update the titles...
asked by 22.03.2016 / 16:01
1
answer

Update by changing one value by the other in the table

What update would you use to change one value for another in a table. A update in table produtos column cod_produto . I would like a query where in the table named produtos all that contain in the column...
asked by 19.09.2015 / 15:21
1
answer

Update sql with 2 conditions

I have a table with the STATUZ column This column consists of 3 possible values: NEW, VISUALIZED, DISCARDED I have a function where I need to implement a SQL row that updates my table and changes all the values in the STATUZ column to: D...
asked by 15.07.2015 / 23:39
2
answers

Update with SET from another table

I'm trying to do an update with JOIN ... The following statement was just a kick, to get the idea of what I want to do: UPDATE PCPSEQPROC_001 PCPSEQPROC SET PCPSEQPROC.ID_PCPSEQPROC = PCPSEQ.ID_PCPSEQ INNER JOIN PCPSEQ_001 PCPSEQ...
asked by 29.03.2018 / 21:40
1
answer

Update on more than one line

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...
asked by 05.06.2017 / 15:25
1
answer

Error updating a table. (Duplicate key)

Good. When doing the update I get error .. Yes I already have a record in the table with those values, but when changing the type should not let me do?     
asked by 24.02.2016 / 09:55
1
answer

Make an update of several fields and values in the same table

I'm making a very simple inventory control system, and in the edit part of the products, I'm doing it this way: I query in a database, and clear text fields with the name of the products and the respective quantity , as in the attached image: In...
asked by 15.07.2015 / 00:11