Questions tagged [sql-update]
An SQL UPDATE statement is used to change existing rows in a table.
11,408
questions
-1
votes
0
answers
26
views
Update data in temporary table with new records found with joins on other table
I have data in a temporary table and I need to update this with the new data found with other tables using joins. How can I change the second select to an update statement?
Can you please suggest how ...
0
votes
1
answer
70
views
What is the best way to update a table column based on a result of a sql select query C#?
The original query :
with Tr As (
SELECT
DocDtls.Warehouse,
Transactions.Code,
DocDtls.zDate,
Transactions.ID,
Transactions.QtyIn,
Transactions.QtyOut,
Transactions....
-1
votes
0
answers
24
views
Update data through $_GET['id'] method in php BUT ERROR [closed]
i`m getting id through $_GET['id'] but the data didn't updating. if I can simply put the id of the Data row and then updated the successful data.
Code Here:>
....php
php
...
1
vote
2
answers
19
views
How to update a jsonb column with a replaced value in pgAdmin?
I have a PostgreSQL table called files which includes a jsonb table called formats. While some rows are [null], others have objects with this structure:
{
"thumbnail": {
"ext"...
0
votes
0
answers
15
views
Updating sql db with records from dataframe pandas
I have a sample database with five columns and five rows of data. The first two columns are unique for every row. Some of the cells in the database are intentionally empty.
I have a dataframe with ...
2
votes
1
answer
13
views
Update column values based on equal values in another column
I'm using MySQL Workbench:
Starting point:
ParcelID Address
=====================
44 street xxxx
32 street yyyy
44 empty
44 null
12 empty
12 street ...
0
votes
0
answers
18
views
Automatically update row if it was not updated in the last N minutes
i'm kinda new to SQL and i've been trying to figure this out.
Let's say i have this table called 'users' that tracks if a user is currently active.
+----------+--------+------+-----+---------+---------...
0
votes
1
answer
52
views
BigQuery - SQL UPDATE and JOIN
i have two tables. Table1 = dalio which is an event list with select customers. Table2 = master_list which is a master customer list from all past events.
dalio has an "id" column that needs ...
0
votes
1
answer
60
views
Python Script to run SQL query UPDATE statement to loop through each row in result set and update columns
Newby working on my first project. Sorry for this explanation.
I have 2 x tables:
t1: master table with single rows (unique project-id) and 3 status fields, s1,s2,s3
t2: list table with repeating ...
-3
votes
1
answer
27
views
how to update columns of a table by fetching some numbers from another column in SQL Oracle [closed]
which have few columns (ID, text_info_AB, num_A, num_B).
I need to update the column num_A and num_B by extracting the numbers mentioned in column text_info_AB. How to do the same in SQL Oracle.
my ...
0
votes
0
answers
11
views
How to make oledb update sql statement for excel where column name use white space C#
How to update excel where the column name contain whitespace
this is the code
OleDbConnection Wn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + PPath + ";...
0
votes
0
answers
17
views
Cant update a entry in Angular
When I try to update an entry i don't have any errors but nothing happens
I dont have much idea of angular, i am sorry.
This is my html
<div class="modal-body">
Id del Envío: ...
0
votes
0
answers
25
views
Include data from joined table in update clause - Laravel Eloquent
Good day,
I've been trying to wrap my head around this but can't manage to get this working.
I'm creating an update with a join.
I'm getting data from the second table to update columns with that data ...
0
votes
3
answers
59
views
Update column from column from another table partially matched
I have two tables, the first table is called IM_ITEM and has the following columns
ITEM_NO
DESCR
BRAND
10000
Orin Swift Black
" "
10001
Gold Peak Sweet tea
" "
10002
Vara Red ...
0
votes
1
answer
51
views
UPDATE SET SUM IN SQL FROM ANOTHER TABLE IN VB.NET
I want to update the set sum but my code is not perfect, maybe I need to add or modify the sql.
I tried "UpdateTABLE2()" but the result is not yet in accordance with the output result I want
...
0
votes
0
answers
25
views
MySQL - UPDATE returns syntax error using serialized data
I'm having troubles with this command
UPDATE wp_usermeta
SET meta_value = REPLACE(
meta_value,
'a:1:{s:6:"seller";b:1;}',
'a:1:{s:11:"wcfm_vendor";b:1;}')
WHERE meta_key ...
1
vote
2
answers
52
views
How to rewrite this sql query, that updates multiple rows in a single column, WITHOUT using CASE
I am working on a new project and am trying to update multiple rows in a single column. It appears any query using the CASE syntax is throwing an error. I am needing to rewrite this query so that ...
-1
votes
1
answer
34
views
How to resolve this syntax error in a postgresql sql query to update multiple rows in a single column
Given the tableA in a Postgres database, I need to update multiple rows in the field column_a:
UPDATE tableA
SET
column_a = CASE WHEN column_a = 'conserve' THEN column_a = 'fixed',
column_a = CASE ...
-1
votes
1
answer
29
views
Replace all email addresses after '@' in PostgresSQL
I have a list of emails. I want to change all of them to test emails for my test system e.g. sam@gmail.com to sam@test.com. I don't want to use actual emails as those emails are valid and it will be ...
1
vote
0
answers
23
views
How to UPDATE a table entry based on the most recent entry with the same id in another table?
Apologies if I am asking the obvious, but as a beginner, the obvious is not always that obvious.
In an employee database, I am maintaining a table of positions the employee has had during his ...
-3
votes
1
answer
35
views
java.sql.SQLException: No value specified for parameter 9
I just want to ask what I can do or a solution to this problem?
[enter image description here]` private void update_buttonActionPerformed(java.awt.event.ActionEvent evt) {
try{
String ...
0
votes
1
answer
41
views
How to execute multiple update queries using jooq execute or batch execute without code generation?
I am using JOOQ ( 3.10. 5 ) to update records in ORACLE table without jooq auto code generation in below ways
Approach 1- Using DSL execute by using plain SQL String
dslContext.execute("update ...
0
votes
0
answers
27
views
How to write an update statement to update columns and check for prime numbers?
I am just learning to code SQL. Can someone help me with an update statement, I have done the insert but am stuck with an update. My table prime_test has two columns number and is_prime
Here is the ...
0
votes
1
answer
35
views
Update field for new entries only
I am trying to work out a way to be able to update the Unit Code for any new Unit Offerings but keep the original unit code for the Unit Offerings which have already been created.
I.E if the unit code ...
0
votes
2
answers
29
views
update sql to update lowest hierarchical data for each row in a table
I have a table as shown below
id
previous_id
latest_id
1
null
null
2
1
null
3
2
null
4
null
null
5
4
null
6
6
null
I want to update the table by setting the latest_id column value to lowest ...
0
votes
1
answer
35
views
BigQuery How to update multiple numeric columns by the same rule?
Is there any way to update multiple numeric columns by the same rules?
Before:
After:
Numeric columns multiple 10
My Query:
select id, (sales*10) as sales, (spend*10) as spend, product
from table
...
2
votes
2
answers
38
views
Column update - SQL UPDATE statement
I have a column where it stores a reference
the reference is usually 30 alphanumeric values
The column is set as an nvarchar (30).
Id like to update this to nvarchar (5), and update all the values ...
0
votes
1
answer
23
views
No Update in MariaDB on System-Versioned tables if the data is the same
Is there a way to tell MariaDB to not Update a row in System-Versioned Tables, if the data did not change?
I have a batch job that sets the correct status in my table, and I don't want to always check ...
1
vote
1
answer
16
views
Is there a way to make my app constantly look for connection in the background?
I'm trying to figure out if it is plusible to make an app constantly look for any kind of internet connection so once it finds any it makes a comparison of its local database with the one in the cloud ...
0
votes
2
answers
42
views
SQL Update table where Relation is inside other table
hello I have two Table where table number one is for product and table two is the category i want to update using the this SQL but keep getting syntax error
UPDATE product SET local_delivery = 0,...
-2
votes
2
answers
35
views
The multi-part identifier "[column name]" could not be bound in UPDATE of TEMP Table
I am trying to create a stored procedure whereupon I input a (simple for now) query into a temp table, and then replace some of the data with data from a different table based on a key.
Here is the ...
1
vote
2
answers
58
views
Update database table row if a qualifying token is provided
My code works fine, but is this a efficient code, like on line 16 (commented) I was thinking to use $row and compare with a variable mentioned above, rather than writing another SQL query.
I tried ...
0
votes
2
answers
27
views
Find difference between two table in SQL and append back result to source table & update column values only for newly inserted rows
I am new to SQL Server. I want to create a procedure which should check difference between master table & quarterly table and insert the different rows back to the master table and update the ...
0
votes
0
answers
34
views
How to replace a specific value in a MySQL row if the word is exist?
How can I replace a specific value in MySQL if it's exist?
I have a servers table in that table I have an opts row the row's value is:
+set net_port 28112 +set rcon_password asd +set fs_game mods/...
0
votes
1
answer
24
views
SQL insert and update data into column based on other Table column
I have two tables:
table PRODUCTS
| ProductID | ProductPrice | ProductSupplier |
+-----------+---------------+-----------------+
| 1 | 25 | CompanyA |
| 2 | 35 ...
0
votes
1
answer
32
views
Add a new table column with data extracted from existing column
To preface, I'm using PostGIS and pgAdmin4 to do all of this work.
So I've imported a set of rasters into a database with the "rid", "raster" and "filename" columns.
I ...
-1
votes
0
answers
31
views
Below code executes MySQL update. While using the method args in query, I get java.sql.SQLSyntaxErrorException:You have an error in your SQL syntax
if (ch == 2) {
// Update
Scanner sc2 = new Scanner(System.in);
System.out.println("Enter Student Name : ");
String name = sc2....
0
votes
1
answer
40
views
MS Access - Update Latest Note Using Joined Tables [duplicate]
First, thank you in advance for your assistance.
I have two tables in MS Access: [BillNotes] which holds notes pertaining to Bill #s and [OpenBills] which holds Bill information.
Question: How can I ...
0
votes
0
answers
13
views
replace all values in dimension with new value
I am looking for a function something like coalesce or replace that will allow me to change all values in dimension to some different value e.g. 'bla'. Something like Replace(dimension,'bla')
I know ...
0
votes
2
answers
50
views
Stored Procedure to Update Table with a Variable Column Name
I am trying the write a stored procedure in plpgsql to simply update an integer value in a table. I have a table (called conditions) with four columns of type integer called structure, missing, ...
1
vote
1
answer
78
views
Error "duplicate key value violates unique constraint" while updating multiple rows
I created a table in PostgreSQL and Oracle as
CREATE TABLE temp(
seqnr smallint NOT NULL,
defn_id int not null,
attr_id int not null,
input CHAR(50) NOT NULL,
CONSTRAINT pk_id PRIMARY ...
1
vote
1
answer
23
views
Update table, set ID based on relation. Column not found
I have the following update statement, but it says [42S22][1054] Unknown column 'b.user_id' in 'on clause'
UPDATE brands b set b.workspace_id = (
SELECT w.id from workspaces w
INNER JOIN users u ...
-3
votes
2
answers
52
views
Trying to update table in SQL using visual studio and getting this error 'Incorrect syntax near ','.' [closed]
string Query = "UPDATE dbo.acca_Problems SET UserID = @UserID, Name = @Name, Description = @Description WHERE Name = @Name, Description = @Description";
...
0
votes
2
answers
43
views
SQL—copy rows from one table to another on index change
State description
I have two databases, DB1 and DB2, that have the same table, Author, with the fields Author.ID and Author.AuthorName.
The DB1.Author has the AUTO_INCREMENT on its Author.ID field, ...
0
votes
1
answer
29
views
How can I extend an SQL table with new primary keys as well as add up values for exisiting keys?
I want to join or update the following two tables and also add up df for existing words. So if the word endeavor does not exist in the first table, it should be added with its df value or if the word ...
-1
votes
1
answer
43
views
Violation of PRIMARY KEY constraint SQL Server
string query = "UPDATE Completed_orders SET service=N'" + comboBox1.SelectedValue + "',kolvo=N'" + kol.Text + "',note=N'" + not.Text + "' WHERE orders='" + ...
0
votes
3
answers
42
views
What are the scoping rules for UPDATE when mixed with a JOIN?
Whenever I read how to use a JOIN to UPDATE a table, the usage of aliases always throws me off just slightly. For example, take this code from here
UPDATE ud
SET assid = s.assid
FROM ud u
JOIN sale s ...
-1
votes
1
answer
85
views
+50
UPDATE rows only where a matching row exists in the same table
I am trying to update a table named qc only when first.value is equal to second.value.
An UPDATE query without FROM updates every value which is not what I want. I tried this, but it's still not ...
0
votes
1
answer
22
views
Can't update a specific column in Sequelize
I have a model. It is for the intermediate(pivot) table.
UserCars.init({
carId: DataTypes.INTEGER,
userId: DataTypes.INTEGER,
title: DataTypes.STRING,
}, {
timestamps: false,
...
0
votes
1
answer
36
views
Cycle through columns and change value is empty
I have the following table that is comparing two similar tables:
Source
Part
Info 1
Info 2
...
Info 12
Description
Color
Table 1
Wheel
Circle
...
Long Distance
Table 2
Wheel
Circle
Rubber
...
Long ...