Skip to main content
Filter by
Sorted by
Tagged with
2 votes
2 answers
180 views

I have two tables: demo at db<>fiddle Table keywords has two columns id and v (which hold the keyword's value) create table keywords( id int generated always as identity primary key ,v text ...
Thomas Tempelmann's user avatar
0 votes
1 answer
60 views

I have tried to fix this for several ways, both by binding as String, Date and now by omitting the Date from the binding. Please see the code block below which illustrate the example where I have ...
Jess N's user avatar
  • 21
-1 votes
2 answers
229 views

I'm running a MERGE statement in SQL Server where the source table has a single row with a requestMaterialId that matches with a row in the target table. My expectation is that the WHEN MATCHED clause ...
Ibo's user avatar
  • 4,319
0 votes
0 answers
117 views

I have a merge, correlating on a primary key, I want to insert when the id doesn't exist in target, delete if it doesn't exist in source, and update if fields on the record are different. MERGE INTO ...
Jeremy's user avatar
  • 46.8k
0 votes
1 answer
253 views

I am writing the following merge query in AWS Athena, according to the documentation a table or a query can be input to the merge statement. I have a iceberg table in Athena that needs to be inserted ...
Satish Parida's user avatar
0 votes
2 answers
49 views

I have 5 tables in total. I wrote the initial sub query to gather the proper Pace IDs/Product IDs according to the Master Product ID. However, when I go to join to the Status/Record Tables in my ...
AmachineR's user avatar
0 votes
1 answer
104 views

As a title says - I have two tables, Address with the key addrId (int, identity), and Company with the key coId (int, identity). The relationship between them is many-to-many, so I have a 3rd table ...
Dmitriy Ryabin's user avatar
1 vote
1 answer
461 views

I want to merge 2 tables only if all of the IDs in the source table exist in the target table. But it is not possible to throw exceptions inside merge clause. What are my alternative options to ...
simha rif's user avatar
-3 votes
1 answer
100 views

I have the following script which works on our SQL Server 2016, but throws the following error on production, which unfortunately is still running SQL Server 2012: Msg 325, Level 15, State 1, ...
Mych's user avatar
  • 2,583
0 votes
2 answers
272 views

I have two tables: src: ID model accy delivery_date ETA call_off department style duration plant 123abc xxyy MM 2022-12-14T00:00:00.000Z 2022-10-20T00:00:00.000Z 2023-01-17T00:00:00.000Z paint pink 3....
somedude's user avatar
1 vote
2 answers
366 views

I am trying to write an update or merge BigQuery SQL to update the data_profile.name of table1 (repeated column) using another reference table having dataprofile data of table2 (flattendata). Using ...
DataVishesh's user avatar
0 votes
1 answer
31 views

I need to get transaction_dates in transactions table to write on a column in a table named payment_plan. But i need to do this operation just for polices that has payment_method as directdebit and ...
Batuhan Gedik's user avatar
-4 votes
1 answer
652 views

I am trying to UPDATE target table but in source table I have duplicate data. I am trying in Azure SQL Server database. All will be ok with HASHBYTES but if I remove HASHBYTES it will raise an error: ...
Дрвосеча's user avatar
0 votes
1 answer
349 views

In sql I want to update a table when the data is not present in source. Target Table Source Table so now for EmpId 1 is not having courseid 3 in source I need to update it need to change isthere ...
Garapati Gokul Sairam's user avatar
1 vote
1 answer
80 views

I’m having an issue with HSQLDB and MERGE with the following merge logic if I use an OffsetDateTime with offset +00:00 private static final String CREATE_TABLE_SQL = "create ...
lance-java's user avatar
  • 29.4k
0 votes
2 answers
369 views

i'm trying to update a column in a table using the id of another table only if one or two field match each other. Sadly the query run very slowly and i don't understand why. PS:(the checked fields for ...
user1974059's user avatar
0 votes
1 answer
177 views

I have the following effective dated table with several thousands records that would need to be updated/inserted based on certain criteria. Table Car_Specification: Effective_Date Car_ID Num_Wheels ...
user1008697's user avatar
  • 1,151
0 votes
1 answer
516 views

I am trying to make up for PySpark's lack of 'WHEN NOT MATCHED BY SOURCE' in MERGE statements. I want to delete rows from a table when there are no matching rows in another table. However, my table ...
Daniel's user avatar
  • 123
0 votes
0 answers
169 views

Ran the following query which I expected to insert or update only one row. But the query inserted 24923 rows which is the total number of rows existing in the table at the time of running this command....
gcpdev-guy's user avatar
1 vote
1 answer
1k views

This is my first time working with dbt! I have successfully implemented an incremental model using #db-bigquery with following config like so {{ config( materialized='incremental', alias='...
Yunus Einsteinium's user avatar
0 votes
0 answers
552 views

I would like to know if a MERGE statement could, somehow, be written to support value sets with different column counts? First, if we had a table that is defined as follows: CREATE TABLE [Example] ( ...
Eric's user avatar
  • 1,317
2 votes
1 answer
823 views

Does anyone know what is the lock level (row, table) on PostgreSQL MERGE command? I tried to dig deep on the documentation but I couldn't find anything that could clarify my mind. If anyone have a ...
wmrodrigues's user avatar
0 votes
1 answer
642 views

I have the following MERGE statement.Is there a way to convert this into an update statement without using MERGE? MERGE INTO tab1 USING (SELECT tab1.col1, tab2.col2 FROM tab1, tab2 ...
user2280352's user avatar
1 vote
1 answer
391 views

CREATE SEQUENCE e_demo2_tab_sq; CREATE TABLE e_demo2_tab ( tab_id NUMBER(10) DEFAULT e_demo2_tab_sq.nextval NOT NULL, e_id NUMBER(10), e_uuid NUMBER(10), seq_cnt NUMBER(10) )...
Vicky's user avatar
  • 681
6 votes
3 answers
11k views

I have a table with an auto incrementing id and a unique constraint across two columns, keycol1 and keycol2. Suppose the table has this data: H| (id, keycol1, keycol2, col1, col2) | (1, 'A', 'B', ...
Menasheh's user avatar
  • 3,737

1
2 3 4 5
7