All Questions
Tagged with insert-update sql
244
questions
2
votes
1
answer
57
views
Microsoft Access SQL [duplicate]
I am looking for a solution to fill fields in an Access DB SQL statement.
Any suggestions?
Example of the dataset attached:
Goal:
I am looking for a solution to fill fields in an Access DB SQl ...
0
votes
1
answer
26
views
ORA-30926: unable to get a stable set of rows in the source tables when updating a a table in a database using another table in another database
I am trying to update a table in a database using another table in another database. This script was working fine until recently when I started getting the error: ORA-30926: unable to get a stable set ...
1
vote
1
answer
335
views
Azure SQL - Select Into - Update if exists, else create
I am using Azure SQL for an Application DB, and am trying to create (and subsequently kep updated) some lightweight tables from the more complete tables the Application uses.
Main reason for this is ...
0
votes
2
answers
225
views
Insert Into On Conflict With a Where Clause
I have a SQL query that looks like this:
INSERT INTO testing.names
(
id,
first_name,
active_status
)
-------------------------------------
SELECT
stage.id,
stage.first_name,
...
1
vote
2
answers
333
views
Column reference in "On Conflict" is ambiguous
I created the following table:
CREATE TABLE IF NOT EXISTS public.publications (
publication_id bigint NOT NULL DEFAULT nextval('eap_publications_publication_id_seq'::regclass),
title character ...
0
votes
2
answers
229
views
Replacing the column values based on Regex matching SQL
I have my HANA SQL query
select
replace_regexpr('[ \t]+$' in "id" with '' OCCURRENCE ALL)
from TABLE1
that will display the replaced trailing whitespaces for the column ID without ...
0
votes
1
answer
60
views
Need PLSQL block to update Table A and also insert same values in Table B
I need to write a PLSQL block that copies values from Column A for a certain record in Table A and updated the copied values in same Column A for another record in the same Table A. Also, these values ...
2
votes
1
answer
424
views
Insert data from Table A to Table B, then Update Table A with Table B ID
I currently have two tables like the following:
Table A
TableAId
TableAPrivateField
CommonField1
CommonField2
CommonField..
TableBGeneratedId
1
datadatadata
datadatadata2
datadatadata3
d...
NULL
2
...
1
vote
1
answer
424
views
Upsert records in postgresql
I am working with postgresql database and I have below update query which works fine -
'UPDATE "main"."item_vendor"\n' +
' SET\n' +
' "vendor_id" = $1,...
0
votes
1
answer
704
views
Copy first row values to all rows and update two columns value from another table
We have a table where the first row will be updated with UI input through API, we have to replicate the same data for different dates from another table.
How do we do it in SQL (working on SQL Server ...
0
votes
1
answer
48
views
Update a single row in a table in SQL
So, I am creating a new table that gets populated from another table. NewTableA.ColA is getting populated from an existing OldTableB.ColB
Source query that populates NewTableA.ColA:
SELECT TOP (1) ...
-1
votes
1
answer
73
views
i can't add column from query to table as new column (postgresql)
I selected only digit from column and want to add this new column to my table with selected digits
SELECT
left(orgi.dt_new, strpos(dt, ' ') - 1) AS day_
FROM
(SELECT *,
CASE
WHEN ...
0
votes
1
answer
143
views
SQL to update rows to remove words with less than N characters
I have a TAGS column in my Products table in SQL Server. In my web project I split them with space, for example:
"web web_design website website_design"
=> 1.web 2. web_design 3. ...
0
votes
1
answer
148
views
Update SQL table using selection from another table
I want to update the values of a SQL table based on the value from another table where the two tables have a common ID.
When I run my script it says it work. But when I check the table that should ...
0
votes
2
answers
122
views
How to insert data into table with composite unique keys
I have a table demo where I have 5 columns as below:
Create table demo
(
Demo_id number,
demo_a number,
Demo_b number,
Demo_c number
)
So here demo_id is surrogate PK and ...