update's questions - English 1answer

689 update questions.

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 ...

I need to update the "oldest" row in the database (for now, its limit 1, but I need to also be able to set it to n). I'm essentially doing a constant stream of "update the oldest rows and retrieve ...

With stored procedures in PostgreSQL v10.1.2, which is the fastest way or which is better: to check if rows exists and then update or try to update directly with the possibility that no rows matching ...

I have a Postgres database which contains details on clusters of servers, such as server status ('active', 'standby' etc). Active servers at any time may need to fail over to a standby, and I don't ...

I've tried writting this update statement every possible way I can think of but I either wind up producing invalid results or run into a syntax barrier. I have two table variables: DECLARE @...

I have a table with an OrderSequence column. The schema looks roughly like this: id Name OrderSequence I have an array of ids ["1", "2", "3", "4"] from an application, and I want to set the ...

This is probably simple but it's been puzzling me for hours. Task to run a count of _pageviews for _remote_addr (ip address). Each day the table will be truncated to start the counts again. CREATE ...

As per Postgres UPDATE ... LIMIT 1 I'm trying to update a single record but based on a join. However, ~30% of the time on the pre-installed postgresql 9.5.5 from travis-ci the following SQL actually ...

I can't figure how can I update an element in a PostgreSQL 9.3 datatype. My example: CREATE TABLE "user" ( id uuid NOT NULL, password character varying(255), profiles json, gender integer ...

I've got a table containing around 15 million rows, where each day a number of them will need to be updated. The first time we run this, it will probably update ~13 million rows, and then after that ...

EDIT: Here are two database Files that demonstrate an applied example of the problem: Example_DBs.zip (Zipped due to 2 link limitation.) Note: The missing Field in "Not Working.mdb" is intentional....

I need to optimize this query, or change some configuration, because execution takes too much time. Query with rows as ( update hotmail.clean_us_usdataclean_1 set offers_excluded=case when ...

I am updating a column to values based on conditions from another table. I want only the values to be updated for rows where the condition meets. It shouldn't overwrite the rows where the conditions ...

I've found a lot of similar questions, but not exactly what I need. I want to make a SQL command to find all duplicate email rows and update the notes of them with 'do not email' if it is written in ...

Bit of a strange question. Entries in my table have three relevant columns: drug date_1 date_2 seq_id I am trying to make it such that every drug with the lowest seq_id has a date_2 equal to the ...

I need to write an export module which marks exported rows as exported. We currently run SQL Server Express 2012, but may switch to Oracle, so I need a client-side approach. We are currently using ASP....

I have this table: SELECT * FROM items id | item | position ---|-----------|---------- 1 | USB cable | 0 2 | SD card | 4 3 | Mouse | 2 4 | Keyboard | 0 5 ...

Given three tables: A users table with id's: ╔════╗ ║ id ║ ╠════╣ ║ 1 ║ ╟────╢ ║ 2 ║ ╟────╢ ║ 3 ║ ╚════╝ A purposes table with user_id's ╔════╤══════════╗ ║ id │ user_id ║ ╠════╪══════════╣ ║ ...

I use a column called sequence on tables where I have to re-sort blocks of rows into an arbitrarily order. CREATE TABLE `tkmemberstage` ( `ID` bigint(22) unsigned NOT NULL AUTO_INCREMENT, `...

I have a users table with autoincrement id as primary key, and unique key on email. The email and name fields are from facebook. +----+-------+------+ | id | email | name | +----+-------+------+ And ...

I am new to PostGis, and I would be grateful to any help to my problem! Tried several solutions but I failed... I have a table of point locations in certain city (tableA) and another tableB which ...

I'm troubleshooting an issue on SQL Server 2000 where it appears that a update statement in a stored procedure failed, and the check for @@ERROR <> 0 didn't catch it, so the transaction was ...

I added some entries from table2 to table1 as INSERT INTO table1 (title) SELECT title from table2 WHERE ... how can I UPDATE table2 for the SELECTed or INSERTed entries as UPDATE table2 SET status='...

I have 2 table in my database. Table #1 ------------------------------------------------------------------------- | name | family | phone | email | gender | phone2 | address | birthdate | -----------...

I am getting an error while running an update query with table name specified along with column name: UPDATE Temp SET Temp.Id='234',Temp.Name='Test'WHERE Id='245' This is the error: ERROR: column "...

Programming stored procedures isn't my strongest point when it comes to programming, but I'm trying to get better. I've stumbled upon a business requirement that's kind of hard for me and I was ...

I need to UPDATE all rows for multiple columns on a large INNODB table. Each UPDATE processes one column separately and takes about 1 hour. I have to do this for 10 columns so it would take 10 h I do ...

I have a table in the name of ips as below: CREATE TABLE `ips` ( `id` int(10) unsigned NOT NULL DEFAULT '0', `begin_ip_num` int(11) unsigned DEFAULT NULL, `end_ip_num` int(11) unsigned DEFAULT ...

In MariaDB 10.3.9: SELECT COUNT(*) FROM photos vs UPDATE counts SET countValue = (SELECT COUNT(*) FROM photos) WHERE countName = 'photos'; The select takes 1.1s vs the update which takes 2.6s. ...

How can I subtract the quantities in table2 from table1? I'm using SQL Server 2014. Table1 P_ID name quantity 1 carrot 100 2 eggplant 100 3 Avocado 100 ...

I have a new column in SQL Server 2016, on a table of type bit. (I wanted it to be a persisted calculated column but was overruled and asked to make it a bit that is maintained by program code). Its ...

I have database_1 and database_2 both on the same server. How can I instantly update the USER table in database_2 when data is inserted into the USER table in database_1? Structure of both tables: ...

I created an insert trigger in a table that will fire when an insert/update/delete is made. The trigger is supposed to send information about the query that fired it, but every time it fires, the ...

I have a document like this: { wid: 1, items: [ {nid: 1, sent: 900}, {nid: 2, sent: 12}, {nid: 3, sent: 0}, {nid: 4, sent: 1} ] } Now consider I want to ...

I have ran an UPDATE query in postgresql. After 5 days it has not finished yet. Is it possible to check percentage of completeness of my query which I have ran previously. I want to know if it takes ...

(codeigniter) I Want To insert data in transaction table and at the same time update customer table . I want to Add value of ChangeDue in transation table To value now_debt in Customer Table ...

In a SELECT query of SELECT b.id, MIN(IFNULL(a.views,0)) AS counted FROM table1 a JOIN table2 b ON a.id=b.id GROUP BY id HAVING counted>0 How can I turn this query to UPDATE as UPDATE b.number ...

Say I have a table with some columns: CREATE TABLE t ( key int PRIMARY KEY, c1 int, c2 text, c3 timestamptz ); I now fetch a row from the table: SELECT * FROM t WHERE id = 180; ...

I'm using SQL Server Management Studio 2005. I want to look up a column value in another table, using a shared ID tblOrder_ordernr in both tables, but only update one table. To me, the query is ...

For testing purposes I periodically restore production backup into a new database (AWS RDS PostgreSQL instance) with pg_restore. In the new database I run SQL queries that anonymize sensitive data. ...

I have to update many records. I don't want to duplicate the entries. The table concatenates the value to the end. So in theory, I could add the value twice. I want to put a check to make sure the ...

I am working on complicated problem, but I will simplify it to this problem. I have two tables A [ID, column1, column2, column3] B [ID, column1, column2, column3, column4] and I want to update the ...

Can't seem to figure out how to update a single field. Whatever I try, to update one field (picture: "url") the rest of the fields are being removed and set to null. I use the following command now: ...

I am working on scrambling PII tags in CLOB columns such as <FirstName> or <LastName> or <SSN_Number>. so I am using the below query to achieve the same. UPDATE /*+PARALLEL(8)*/ ...

Situation: there is a table "Tours" which contains a lot of generated records with different properties (Color, Priority, PickedUp). The goal is to allow external application (over REST API) to pick ...

I am attempting to remove an element from my database. The element I want to remove is within a JSON object called playerContainer which contains an array named players. This all sits within a table ...

I want to create a trigger that set a column to to_sync true if the other columns has been changed. CREATE TRIGGER [dbo].[product_trig] ON dbo.product AFTER UPDATE SET NOCOUNT ON; IF NOT ...

I have a table with following definition: create table json_test ( filter_data jsonb); and i insert to it values like this: '{"task_packets": [ { "state": "PROCEEDING", "...

Say I have a table with columns C and D (among others but these are the relevant ones) with the date type. I am instructed to update the values in C to be 90 days before its corresponding value in D, ...

I'm writing a trigger for a SQL Server database. What I want is, when a table is updated, check if a specific column is updated or not and if another column has a value = 'W' or not. If it is so, the ...

Related tags

Hot questions

Language

Popular Tags