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

0
votes
0answers
10 views

Update or Insert on a Table based on a column value [migrated]

I have two tables BASE and DAILY as shown below: BASE Cust ID IP address 1 10.5.5.5 2 10.5.5.50 3 10.5.5.6 DAILY Cust ID IP address 1 10.5.5.5 2 10.5.5.70 ...
1
vote
2answers
62 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 ...
-1
votes
0answers
18 views

After Update Trigger - create record each time an account is updated [on hold]

I need help creating an AFTER UPDATE trigger to add an ‘UP’ record to the Log every time an account is updated (money deposited or withdrawn). My code is getting errors: CREATE TRIGGER ...
0
votes
0answers
10 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
7 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
10 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
32 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 ...
0
votes
0answers
19 views

With certain queries cpu at 100% after database update [closed]

Recently I updated my online shop database table with newer data. Table contains typical columns like - status, total, currency, email, address etc. Table has 15569 rows = orders. After update if I ...
1
vote
1answer
36 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
13 views

Column Datatype Conversion Question [migrated]

I have a varchar column with text formatted like so "Sun Aug 07 17:43:55 +0000 2011" How would I convert that column in PSQL to a date datatype?
0
votes
0answers
30 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
48 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
18 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
26 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
37 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
68 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
9 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
32 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
61 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
40 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
42 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
43 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
77 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
35 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
12 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
29 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
26 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 | ...
1
vote
1answer
114 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
49 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
60 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
22 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
26 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 ...
0
votes
1answer
37 views

Is it possible to update a field value in one table based on data inserted into various other tables?

Suppose I have a table representing clients. There is a field called last_active in the table which contains a time stamp. When a client uses the database they can insert data into one of four ...
0
votes
1answer
19 views

Update multiple meta_value with single query

Here is a similar structure of a table that I am working on. |--ID--|--user_id--|--meta_key---|--meta_value--| |--1 --|--444444---|--first_name-|------NULL----| |--2 ...
0
votes
0answers
44 views

Sleeping queries blocking rebuild index and update statistics job in Always on

At one of your client sides we have configured Always on with synchronous mode.Also we have schedule rebuild index and update statistics job which runs in night every alternate day. the issue is ...
0
votes
1answer
47 views

MySQL Cluster error on UPDATE: increase MaxNoOfConcurrentOperations

I had a table with ~0.5M rows and tried to exec simple query, something like UPDATE table SET col1=-90 + RAND()*90, col2=-180+RAND()*360 WHERE col1=9999 but result was ERROR 1297 (HY000): Got ...
0
votes
1answer
27 views

Update statement with a function

I'm just curious. I was trying to optimize an update statement with a function Ex update circle set area = fnGetArea(radius) where ...<bunch of conditions> This update went 5-10mins and when ...
0
votes
1answer
76 views

How to update a (very) large table without locking in MySQL

I have a large table (58+ million records) which represents a relation between two records (player and target) in a second table. Unfortunately, whoever designed our schema didn't think things ...
1
vote
2answers
56 views

How to update the parent/child of all rows in the tree (ltree)?

Here are my configurations: DB type: postgresql (9.3 if that's necessary) Table name: product_sections Column names: section_id (integer) & section_path (ltree) Detail: I have one reference ...
1
vote
1answer
54 views

Updating one table from another table where non-primary-key field is similar string

I have a database in Access that I am trying to fix (actually, I'm working on a copy of the original). There are two tables, one with data input errors, and a second that is a copy of those errors, ...
1
vote
1answer
272 views

Updating large table (~6.5 million rows) & indexes

I'm trying to update a table with about 6.5 million rows in a reasonable amount of time, but I'm having some issues. We're adding a new column to an existing table and then setting a value for all ...
0
votes
1answer
63 views

Update does not working while select returns right results

I am trying to execute the query below: UPDATE( SELECT Ord.Completed FROM Product P INNER JOIN Order1 Ord ON Ord.OrderID = P.OrderID WHERE EXISTS( SELECT * FROM Delivery ...
2
votes
1answer
88 views

Updating large table worked before, now taking hours

BACKGROUND: I am using a non-production SQL Server to manipulate a large data set and run a few basic calculations. The original data file I have, which is about 30M rows, is missing records (not ...
1
vote
2answers
94 views

T-SQL — Why do ALTER and UPDATE statement only run when separated into their own batch?

I have update and alter statements that are only running when they are put into they're own batch. Below is my shortened version. It'd probably be a good idea to skip the code and read my question ...
0
votes
1answer
17 views

Are my MongoDB servers right in setting?

I have a small web site, so I used two servers. A: master 4G Ram, 96G SSD B: slave 2G RAM, 96G SSD The B server is always for backup, no read, no write. In my application, many users can (and will) ...
-1
votes
2answers
209 views

Update code works in manual stored procedure but not when run as SQL Server Agent Job

I have a stored procedure that deletes all records from an existing table, and then inserts new records. After the insert I have several update operations that change the value of one field. If I run ...
2
votes
0answers
96 views

Update all rows

I want to know the most efficient manner to update every row in an extremely large Oracle table for a single column. For example: update mytable set mycolumn=null; or: update mytable set ...
0
votes
1answer
79 views

How do I report progress of a long running transaction in MySQL?

I have this transaction in a stored procedure: ... START TRANSACTION; WHILE @Codes > 0 DO EXECUTE qry_rand_stmt; EXECUTE qry_insert_stmt; SET @Codes = @Codes - ROW_COUNT(); END ...
-2
votes
1answer
57 views

Find difference between two database and output them in a script sql [closed]

I had a SQL Server 2008 R2 database. I have dump it and made some mods in a copy. So, I have two databases: 1) the older version 2) the new version I need a script SQL to update the number 1) to ...