Questions tagged as 'sql-update'

1
answer

Is it possible to do an UPDATE with data from another table?

I know that it is possible to execute a INSERT with data from another table: INSERT INTO Tabela (Col01, Col02, Col03) SELECT Col01, Col02, Col03 FROM Outra_tabela WHERE Condicao = 'qualquer coisa' But I would like to do t...
asked by 08.12.2016 / 22:03
2
answers

When should I inactivate or delete a record? Good database practices

I have the following question: When should I inactivate a record? When should I delete a record? In case you would like a good practice tip, on which tables does I make a STATUS column? If the tables have this STATUS column I will do an...
asked by 27.10.2015 / 23:14
2
answers

Error updating the entire JAVA table

I am trying to perform a mass update to update all the prices of products registered in the system, adding the value passed by the user to the unit price of the product registered, according to the company entered in the system and the product c...
asked by 18.02.2016 / 14:03
2
answers

Update with Case When you need to where?

UPDATE bethadba.FOFILHOS SET CPF = CASE WHEN CODI_EMP = 61 AND I_EMPREGADOS = 156 AND i_filhos = 1 THEN '00551366133' WHEN CODI_EMP = 57 AND I_EMPREGADOS = 290 AND i_filhos = 1 THEN '00636170993' WHEN CODI_EMP = 61 AND I_EMPREGADOS = 333...
asked by 11.06.2018 / 19:20
6
answers

Remove an undetermined number of "\" in a column in the database

The description field in the product table contains HTML generated by CKEditor (English) to escape content: <table cellpadding=\"\&quot;\\&quot;\\\\&quot;\\\\\\\\&quot;\\\\\\\\\\\\\\\\&quot;\\\\\\\\\\\\...
asked by 29.01.2014 / 13:37
1
answer

Can I change more than one record at a time?

This is the code: UPDATE PESSOAS SET COR = ('Pardo') WHERE ID = 1; But I have 2 more records to do the same procedure, would you do it all at once by adding ID ?     
asked by 27.10.2017 / 19:55
3
answers

How do I search and save a single field?

How can I fetch a single field from the table change it and save this field without having to fetch all fields from the table? The reason for this is simple, I have some tables that have more than 30 columns and this has a high cost of proces...
asked by 22.10.2016 / 23:35
3
answers

How to do an update with a join?

Hello, I'm new to the forum and need help with PostgreSQL DBMS. My question is the following, in the following code used in the MySQL DBMS the execution happens perfectly, because in PostgreSQL it shows an error. MySQL Code: UPDATE user...
asked by 25.03.2016 / 23:59
1
answer

How to update fields with fields from another table?

I'm not able to update a table with the select of another. I have a mdl_user table that contains several columns and created another users_sg to copy some columns. I copied with INSERT INTO users_sg (id, username, firstna...
asked by 17.08.2016 / 16:03
1
answer

Error doing UPDATE when I set varbinary variable to 'null'

Follow the code below: var file = Request.Files; var list = new List<byte[]>(); for (int i = 0; i < 4; i++) { if (file.Count > i) { list.Add(ConvertTo.Bytes(file[i])); continue; } list.Add(null); }...
asked by 13.11.2017 / 21:21