UPDATE changes the values of the specified columns in all rows that satisfy the condition. Only the columns to be modified need be mentioned in the SET clause; columns not explicitly modified retain their previous values.

learn more… | top users | synonyms

3
votes
1answer
15 views

MySQL 1175 Error While Using Primary Keys

What would cause the error 1175 that starts out with: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column.... The problem I have is that I did include ...
3
votes
1answer
39 views

SQL Server: UPDATE permission for table variable

SQL Server 2012 I have a maintenance script that I wrote for some of my operators. They are members of the fixed db_datareader and db_datawriter roles. Part of the script creates a table variable, ...
2
votes
0answers
26 views

How to order by fields of joined table while selecting for update?

For selecting some rows of table Fwt_Chipkarte for update I use the following SQL statement (IBM DB2): SELECT o.Archiviert, o.Id, o.IdComm, o.Kartennummer, o.Konto, o.LetzteAenderung, ...
0
votes
1answer
33 views

Apply operation on all schemas

I have an Oracle instance, with several schemas (all starting with the same prefix). PATT_A PATT_B PATT_C ... All of them have the same table, and I'd like to update all of them in one shot (with ...
3
votes
3answers
154 views

INSERT/UPDATE in same query from previous SELECT with some singularities

I'm trying to perform a INSERT|UPDATE by selecting data from another DB and this is what I have so far: INSERT INTO pdone.reps (veeva_rep_id,display_name,username,`first`,`last`,email) SELECT ...
0
votes
0answers
23 views

Auto increment form field

I am working with a database, with some forms. What I am trying to do is an auto increment field in my form. For example ID -- every time when I type some new record, this field ID should increment ...
2
votes
0answers
39 views

innodb update with limit locks all matching (ignores limit)

For a query similar to this: UPDATE myinnotable1 SET value=5,updated=now(),status=1 WHERE status>10 AND message="match msg" LIMIT 1; I found that innodb engine locks ALL rows matching criteria ...
0
votes
1answer
31 views

Post installation of SSIS for existing SQL Server instance with different build versions

I would like to install SSIS into existing SQL Server 2014 Fail-over cluster instance with latest cumulative update 7 which was applied. I know how to do it but I want to know if consistency of ...
0
votes
1answer
39 views

Tracking the update or changes in mysql table

I need to stream the changes to elasticsearch to keep in sync with my database(mysql). What will be best way to do this ? I have thought for below approaches Using trigger( but my table will have ...
1
vote
1answer
26 views

always error “cannot insert value NULL” sqlserver

I want to update table "tmpiscunitmap.tr_kpi_id" year_period=2016 with value from table "tmp_kpi.tr_kpi_id where year_period=2016" with condition tmpiscunitmap.tr_kpi_id = tmp_kpi.tr_kpi_id on ...
0
votes
1answer
19 views

Table1 ID is auto increment and i also want to store the information from table 2 against that auto generated ID

This table has an auto increment ID on back end. "INSERT INTO `test`.`personal_info` (`username`, `email`,`password`) VALUES ('$username','$email','$password')"; This was for signing up of one ...
0
votes
0answers
19 views

Updating values with randomly generated values?

I've got an .sqlite3 database here. I want to replace all the values of a set distinct number of columns in the database with randomly generated values (the values should be unique). At the moment ...
0
votes
0answers
28 views

subquery in set clause retrieving different values

I want to update the column "kstplcode" using different values coming from column warehouse except the value "main" with their corresponding delivery numbers. I've tried this code but the set clause ...
0
votes
0answers
22 views

How to reorder again' auto increment column' after deleting some rows [duplicate]

I have a MySQL db table, and first column is for id which has auto_increment. I want the first column be reordered after deleting some rows. iIs there any way to do that? id name 1 alex 2 ...
1
vote
1answer
34 views

How to update table1 field by using other table and function

I have two tables and one function: Table1 contains shop_code,batch_id shop_code| batch_id | regstriy_id 123 | 100 | 12 124 | 100 |13 125 | 100 |12 Table2 contains shop_code,shop_name ...
0
votes
2answers
41 views

How to access row value from UPDATE sub query function?

I would need to use UPDATE like this: update offer set (bank, bank_id) = (cost, gid) from ( select cost, osm_points.gid from pgr_kdijkstraCost( 'SELECT gid as id, source, target, walk_cost as cost ...
0
votes
0answers
21 views

PostgreSQL updates hang when two servers involved

I have an update statement that works fine when only a single server is involved, but never completes when it comes from two servers. I'm connecting with JDBC 9.1-902 to a 9.3 database on CentOS 6.6. ...
0
votes
1answer
17 views

How to update array fields in a table in Postgresql?

Say I have a table defined as following: CREATE TABLE my_tbl ( id bigint, a1 bigint[], a2 bigint[] ); I would like to create a stored procedure to append values to a1 and a2. Is this ...
0
votes
1answer
50 views

How to get number of locks acquired by my MySQL Query?

How to get number of locks acquired by my MySQL update query? Is it possible using MySQL Command Prompt or MySQL Workbench? Example query : update employees set store_id = 0 where store_id = 1;
1
vote
1answer
38 views

How does the table scan in an UPDATE WHERE predicated on an unindexed column work?

I was looking into a deadlock caused by two concurrent UPDATE statements: UPDATE [table] SET [column] = 0 WHERE [unindexed_column] = @id My understanding is that because the column the WHERE is ...
1
vote
1answer
43 views

Is there something I can do to make this UPDATE run faster?

I have a relation EnumeratedSensorReading that includes a siteid and a quantityid column. I want to replace these two columns with a single sensorid column. I have added this column, and it is ...
1
vote
2answers
187 views

SELECT and UPDATE in a single query while updating selective fields of duplicate records only

I have a MySQL table named Contacts_table with, say, the following contents: ID NUMBER NAME CITY 001 2222222222 John Doe Los Angeles 002 ...
0
votes
0answers
25 views

Update MySQL column from column in another table

I have a table, products2013, with column upload_id which I would to contain the value upload_new_name from correlating table uploads (also containing upload_id). I tried putting together the follow ...
0
votes
0answers
18 views

MySQL - Update vs. Replace Into — why is Update non-parallel, and Replace Into allows multi-threads?

In trying to optimize a query that does (Insert ... on duplicate key update) .... someone suggested I do "Replace Into" to optimize performance. I'm not 100% certain the difference other than ... ...
0
votes
1answer
33 views

Update Column in table on midnight daily

I am designing a simple 1 table database in mySQL that will have two columns. One column will be the name of a specific restaurant on the webpage I will be using this database with. The second column ...
0
votes
2answers
98 views

MySQL - best practices/ how to speed up "update, else insert' queries? Insert + delete faster?

I'm running an ETL process and streaming data into a MySQL table. Now it is being written over a web connection (fairly fast one) -- so that can be a bottleneck. Anyway, it's a basic insert/ update ...
1
vote
1answer
47 views

Insert/ Update Scalability (more records, continually longer lookups — solution?)

posted this before but never received a clear answer. I'm working on an ETL project and am basically feeding JSON records of "tickets" into a MySQL database. (actually come to think of it, may be ...
0
votes
0answers
33 views

I have a table from which I can retrieve information but I cannot update or delete information

I can update and delete items via PhpMyAdmin. I changed the owner to mysql. My program is a clone of insert, update, and delete that is functioning for other tables within the database. I receive a ...
0
votes
1answer
81 views

SQL Server 2008 R2 service packs

Are the SQL Server service packs 'cumulative' or 'incremental'? The scenario is that we have a couple of instances running on SQL Server 2008 R2 RTM and we have been asked to patch it up to SP3 ...
0
votes
0answers
32 views

How can I use PostgreSQL's partial sum tree index (if it even exists)? Do any databases allow for use of such an index?

GiST (Generalized Search Tree) indexing is an advanced system which brings together a wide array of different sorting and searching algorithms including B-tree, B+-tree, R-tree, partial sum trees, ...
0
votes
2answers
30 views

Problem With update column in table [closed]

there is my problem. I have to update column "date_to" , but only for those users who havent set their last "date_to" to value '3000-12-31' . Table looks like this : ID date_from ...
0
votes
1answer
43 views

MySQL: Updating or closing existing rows in a table and/or inserting new rows?

I want to update a specific table but in the following manner. When a record is completely the same (so not only the primary key, but all fields) then I don't want any changes (or a new record ...
0
votes
1answer
74 views

Rolling update to all rows in innodb table (no rollback if aborted)

I have the following table, which stores the Social Security Death Master File database (~86M rows): CREATE TABLE `death_master_files` ( `id` int(11) NOT NULL AUTO_INCREMENT, `ssn_an` smallint(5) ...
0
votes
1answer
14 views

Building test site, update dates (back date records)

I have 3 tables that all connect and I need to back date them in an MS SQL 2008 setting. I was thinking about how to do this and not sure if I am on the correct path. The big problem I have is I have ...
-5
votes
1answer
35 views

Increment the value of an entire column [closed]

I have a table and one of the columns, is of the data type int. I want to increase every tuple's value of that specific column by 100. I have not found a proper answer for this yet. Anybody?
1
vote
1answer
81 views

updating same column as in the select query

When I try to do this, I get an error saying I cannot use the same table in where select as the column that I am updating. UPDATE table_name SET quantity = 19 WHERE productID = 148357 ...
1
vote
1answer
52 views

MySQL Update a table based on the last data from another table while grouping with conditions

I need a query to UPDATE a series of fields based on another table Table lp_plates_backup | uid | brand | model | | 1 | | | | a | Old | Error | ...
0
votes
0answers
10 views

reorganize and UPDATE [duplicate]

This is my table called tickets with ID primary key ID-TicketID-TYPE 101-3-0 a02-1-0 01a-2-0 I wanted to UPDATE it and be like this ID-TicketID-TYPE a02-1-0 01a-2-0 101-3-0 but when I used the ...
1
vote
2answers
86 views

Sybase ASE find running process

I run UPDATE INDEX STATISTICS on some HUGE table. And it runs already about 1 hour. Is there some procedures/ways to find the percentage of executing this command? sp_who, sp_sysmon don't help. ...
0
votes
1answer
124 views

Mongodb update conditional set operator ($set only when it is insert )

Is there anything in Mongo update where $set when will work only when an insert is done. example is I have a collection which has these fields: Username FirstOccurrence Count What i want that i ...
3
votes
0answers
85 views

Why is my SQL Server query behaving differently on UPDATE than on SELECT?

I've written a SQL Server query that updates records to have a sequential number after partitioning on a field. When I run it as a SELECT statement, everything looks great: DECLARE @RunDetailID INT = ...
0
votes
1answer
40 views

UPDATE statement not consistent when including NULL fields

So I want to append Field B to C, then copy field A to B and set field A to "Awaiting update". I have written the following code UPDATE Notes SET /* append previous month to notes */ Notes=Notes + ...
0
votes
0answers
13 views

Checkpointing in a deferred update database

Something that I just cannot get my head around. Checkpointing writes all dirty pages from ram memory to disk. For Deferred update systems, data changes recorded in the log file are applied to the ...
0
votes
0answers
32 views

PostgreSQL slow update -> does autovacuum have anything to do with it?

I am quite new to PostgreSQL as I only need it to create a map (using PostGIS). So I don't really know on hot how to optimise my DB... I have a table with a lot of polygons that I'd like to save in a ...
0
votes
0answers
38 views

Oracle SQL Updating Trigger Statement

Hey all so let me see if I can clearly explain what I would like this trigger to exactly do. First of all the trigger will deal with 2 tables: Delivery Table: DeliveryNum |ItemName | Quantity | ...
2
votes
1answer
134 views

Update taking too long

I am updating a table with 250 million rows in SQL Server, and it's been running for 4.5 days. I'd like to use the computer it's running on for other memory-intensive work, so I'm torn about whether ...
0
votes
1answer
78 views

How to limit the range of an insert-update to only look at certain rows/ rows with field value: X?

I posted something similar before, but am still unsure of the technical implementation --- I'm so close to being there to the finished product. I have a table of tickets, and a stream of ticket ...
1
vote
1answer
77 views

MySQL Deadlock - accessing different primary key values also creating deadlock

I went through MySQL logs and found the reason for deadlock 1st thread is trying to execute below query. Which is waiting for thread 2. UPDATE M_SAMP SET MM_Q_IND=0 WHERE M_ID IN (SELECT M_ID FROM ...
0
votes
0answers
23 views

Efficient Trigger updating in Postgresql

So I have a big table that often needs specific columns updated for a large number of rows. So right now I have it set up so that there is a 'staging' table that has the update-able columns. Then upon ...
0
votes
0answers
31 views

How to find Deleted and Updated record tables in MYSQL database?

I have scenario like below. I need to find Deleted records and updated records effected tables in mysql. Ex: I update my Name or Email Id in UI that is effected in some tables either one table or ...