Most voted "sql-update" questions
Update is an SQL statement that changes the data of one or more records in a table, as well as a subset of results, and can also be filtered by conditions.
Learn more…270 questions
Sort by count of
-
1
votes3
answers124
viewsUpdate to CD_SETOR column values in all tables found with column
Using the select SELECT * FROM DBA_TAB_COLUMNS WHERE column_name like 'CD_SETOR' i have as a result many tables with different Owner with the same CD_SETOR. EX: Owner Tables Column Type 210…
-
1
votes1
answer105
viewsUpdate with SET giving error
I have several UPDATE with practically the same code as this: UPDATE cliente SET Email = '[email protected]' WHERE idCliente = 0000; But some make this mistake: Data truncation: Data Too…
-
1
votes2
answers801
viewsupdate sql relating a column with external value
Good morning, I’m having a hard time updating SQL Server. I have the following situation: Table 1 ID Codigo Table 2 ID Nome And I have an excel file like this: Excel Codigo Nome I need to update the…
-
1
votes1
answer159
viewsUpdate warn change
You can tell if a value has been changed in a direct table in the application? Like I gave a UPDATE tabela SET valor = 1 WHERE id = 2; And in the application appear the message: O Valor foi alterado…
-
1
votes2
answers75
viewsIs it possible to do an Update this way?
I have two tables, the Table Impressoras is where is stored the data of the equipment, as model, patrimony, etc. And I have the table Impressora Local where the location of the printer is stored,…
-
1
votes0
answers18
viewsPerformance between Mysql Update types
Good evening, I need to update a table 'a' in the rows where there is no occurrence in table 'b', where table b has about 7 million records. I imagined two solutions but I can not say which would be…
-
1
votes3
answers1525
viewsHow to create an incremental Update sql command
I have a table Estoque where today there are already numerous rows of records already registered, how can I do an Incremental Update to fill a column that I added the table now? Produto | N_Serie |…
-
1
votes1
answer61
viewsupload update
I have a problem in the way to save the upload file. I have a php file that does the update that is in the process folder, and an upload folder to save the files that were saved. $id = $_POST['id'];…
-
1
votes1
answer424
viewsUPDATE with 2 Joins POSTGRESQL
I would like to ask for help with an update on Posrgresql I need to update the value of a column in a table, but that goes through conditions of 2 tables. I tried the code: update proced_conv set…
-
1
votes0
answers103
viewsupdate does not work php
Personal I am making a panel in which the user sends an image, but this image is not being made require_once("../classes/seguranca.php"); $nome = $_POST['nome']; $foto = $_FILES['imagem']; $id =…
-
1
votes1
answer41
viewsMYSQL Operation subtraction fields from the same table with different WHERE?
Hello There is a table with TYPE field and Value, Operation value field output (TYPE = REVENUE) - (TYPE = EXPENSE) in MYSQL in a Select…
-
1
votes1
answer29
viewsSQL SERVER delete record after UPDATE
I would like to know if you can delete the records from the source table after performing the UPDATE in another table, that is, delete the row (from the source table) that was used in the update of…
-
1
votes1
answer889
viewsLaravel 5.4 - Update in related tables
What’s the best way to make one update in two tables at the same time? I thought it was just to call the related table, but when I do it only makes the update on the table service and not in the…
-
1
votes2
answers749
viewsIf there is any data in mysql do a PHP/Mysql update
Guys, I imagine this doubt is recurring. I even looked for some alternatives but did not work. I have a Screen where I record Service Orders with Client and PC data from it. It turns out that. I am…
-
1
votes1
answer5981
viewsHow to Update mysqli Database Table with UPDATE?
I am creating a data listing system, and created a data change page, with 6 fields, name, experience, email, phone, city and biography. only that my function does not update the fields. The data…
-
1
votes1
answer459
viewsUpdate table with the highest value from another table in Mysql
I have a table called employees, with the following fields and values: nome salário a 10 b 100 c 30 d 40 I have a second table called function_more_caro, with the same fields as the previous one,…
-
1
votes2
answers302
viewsForce updating an element in HTML/Javascript/ASP.NET
On the site I am working on, the user has access to a text editor to change the Labels in certain photos. When editing the text and giving "Submit" in the responses, the texts do not update on the…
-
1
votes1
answer1299
viewsCreate Trigger after update in the table itself and in another table
First I have a table: create table alecrim( id_alecrim int not null auto_increment, sem_epi int not null unique, p1 smallint, p2 smallint, p3 smallint, p4 smallint, p5 smallint, p6 smallint, p7…
-
1
votes1
answer37
viewsUpdate the remainder of a table from the data contained in a row
The figure below explains well what I want to try to do (and what I tried to do but it didn’t work): That is, I need to update some rows of a table with the same data contained in a row…
-
1
votes2
answers99
viewsUpdate form not saved
I have a form already filled with two extra inputs only for the user to edit the information already registered and add the two new. However, although the alert of "successfully saved", when I…
-
1
votes2
answers217
viewsUpdate item table with stock in any branch
All right Guys, I have a table with stock of products from a network of 13 stores. I want to block items that have no stock in any store and that have not had sales in the last year or that have…
-
1
votes1
answer50
viewsRecord edit form does not change
On one page I have a material registration form, in another I have a table that shows all the materials registered with a button to change the information about a material and this button opens a…
-
1
votes0
answers43
viewsUpdate Error Oledb C#
I cannot use the UPDATE command more than once. (https://drive.google.com/file/d/1xyqp6rA4Rk3AvneFaUlqk6AVvjQjbtSi/view?usp=drivesdk)…
-
1
votes1
answer31
viewsUpdate does not generate errors but does not update the table
I got a problem, and I’m here for help. This I have this code that refers to a complete customer registration form for my site Insert done, works perfectly and writes the information to the database…
-
1
votes1
answer105
viewsHow do you use the UPDATE command more than once?
I cannot use the UPDATE command more than once. For example, when I do the update on id 43, sure. But when I try to finish 44, it does not finish, but 43 that gets the update.. Code: Int att,index;…
-
1
votes1
answer83
viewsUPDATE problem and WHERE clause with two conditions
After a lot of research on the internet without getting a solution, I turn to the "university" on duty! I have two tables: contract (primary key) and contacts. Being the second linked to the first.…
-
1
votes1
answer247
viewsHow to insert this text in Postgresql?
I am using a Delphi query and need to insert the text below in a text field {\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fswiss\fprq2\fcharset0 Calibri;}{\f1\froman\fcharset0 Times New…
-
1
votes1
answer541
viewsMysql trigger to be fired whenever a field is edited
Good colleagues, I have a problem I haven’t solved yet. I intend to create a Rigger that whenever the product quantity column undergoes an update it triggers an action to another table, to allow the…
-
1
votes0
answers57
viewsSeveral Updates from a select RAND
UPDATE `tabela` SET `Relacionar_A` = (SELECT `Relacionar_A` FROM `tabela` WHERE `Relacionar_A`='' ORDER BY RAND() LIMIT 2) I can do the update single, only 1 record from the select. What I would…
-
1
votes0
answers472
viewsHow to update php correctly
Hello I am making an administrative panel where the administrator can edit the Name, User and email but it does not perform the UPDATE in the database but in the message it says that the update…
-
1
votes0
answers99
viewsUpdate after Insert field
I’m trying to create a Trigger to update a value after inserting, or earlier if it worked. I have the following table: test Remembering that the field type date is timestamp and the default value is…
-
1
votes1
answer75
viewsHow to set only one row of the column in which all values in this column are equal?
I’m trying to set the column ocupado just one line at a time, something like: update suite set ocupado = 'S' where tipo = 'i'; But this instruction changes all rows in the column ocupado where tipo…
-
1
votes1
answer283
viewsReturn Select Multiple values
all right with you all, I hope so. I have a question and I’m not getting through with my code. So let’s go I have a register screen with a select Multiple with the data below: <select…
-
1
votes2
answers49
viewsUPDATE only in the last inserted rows
I’m importing some Excel spreadsheets via ETL into a relational database. The problem is that in order for me to achieve the relationship of the tables, I am using queries for the insertion of…
-
1
votes1
answer6293
viewsUpdate a single information in Laravel
I’m starting work with Laravel and I was wondering if you could help me. I need to update a single value in the bank, using 'name' in the Where clause instead of id. This is for a real system…
-
1
votes1
answer367
viewsWhen firing an Update Trigger, one of the fields only updates after a second Update
I created a Rigger to inform the fine about the delay of returning rented movies, however, when firing the Rigger once (giving an UPDATE), the field "Total Fine" does not update (only it). But when…
-
1
votes1
answer292
viewsLaravel informs that the page was not found: 404 on the master/test route
How to make this update work? Below page code. Form_edit.php <form role="form"> <div class="box-body"> <div class="form-group"> <label>Name</label> <input…
-
1
votes0
answers14
viewsHow to update multiple lines in mysql?
I have a table (respostas) MYSQL thus: ID|resposta 1 | A 2 | B 3 | B 4 | C Then when sending the form below it should update the response column according to the value of each input: <form…
-
1
votes0
answers29
viewsUnable to change field in php when id is not 1
Good evening, I’m trying to make a change to my database through php, but when clicking on "change" it only allows if the code is equal to 1, I have already put in html to send the id as soon as we…
-
1
votes0
answers92
viewsTrigger to ban scale insertion that is already working on that SQL Server date
Thank you for your time! 1° I’ll put the data and then I’ll point out my doubt, I’ve tried a thousand times and I can’t get the logic that works. I have the following table Scale Table CREATE TABLE…
-
1
votes2
answers112
viewsChanging table values using UPDATE CASE
hello, I have a table of this template: +-------------------------------+ | participacao | +----+--------+------+----------+ | id | nome | equipe | ativo | +----+--------+--------+--------+ | 1 |…
-
1
votes2
answers79
viewsMake two updates at once
I have a table with some records, I want to change two rows of this table at the same time I’m currently doing this: include("conexao.php"); $tabela1 = "endereco"; $endereco_id= "75";…
-
1
votes0
answers119
viewsUPDATE command on a JSON
Good afternoon, everyone, I’m trying to update a column of my table, but this column stores a JSON Object, only that for this I need to make a where with a JSON also. This one is how the data is…
-
1
votes2
answers121
viewsSQL Update from another tab
Hello, I’m trying to update the product table using the average unit values of one year in the document table (where the notes enter) and the q instruction I’m using returns with error: UPDATE…
-
1
votes0
answers118
viewsI cannot install Mysql, proble with MYSQL CONNECTOR NET 8.0.17
I had mysql on my computer working perfectly a while ago on version 8.0.17, I did the uninstallation months ago and today I had to install again, the latest version is on 8.0.22, when I tried to…
-
1
votes1
answer41
viewsDatabase return in asynchronous function with await
I have an asynchronous function that I need to use await in the return of the database to use this data later when doing the next insertion using the LAST_USER_ID() MYSQL, however, using the await…
-
1
votes2
answers55
viewsPostgresql change an element of a JSON column
Hello, I’m trying to change a JSON column, but I want to change only one element, in this case, the "url". There are some urls that have the symbols ' ' and '$' at the beginning and end, as below:…
-
1
votes0
answers17
viewsCombobox updating the database data
I am developing a page that will serve to edit the support calls : open, pending and solved. But before the fields I created in Mysql I cannot update to update what I want. <form role="form"…
-
0
votes1
answer12979
viewsError Code: 1406. Data Too long for column 'txtContability' at Row 1
In Mysql.. I am wanting to do UPDATE in a text field, the same has about 300 characters and does not allow to do it, informed that it is too long. I’ve tried changing the field type up to…
-
0
votes1
answer1489
viewsupdate mysql using array
I’m having trouble inserting an array into the database... I tried this script but it only inserts the last id of the array; <?php $_conexao = mysqli_connect("localhost", "root", "",…