Hi all,
I have table CLNT table in TERADATA as per below
How would i do this simple command in teradata?
Thank you guys,
I have table CLNT table in TERADATA as per below
Code:
CREATE TABLE [dbo].[CLNT](
[CLNT_I] NOT NULL,
[FRST_NAME] [varchar](100) NULL,
[LAST_NAME] [varchar](100) NULL,
[UPDT_S] [date] NULL,
) WITH PRIMARY KEY (CLNT_I)
CLNT_I is meant to be surrogate key and as you know the identity column in Teradata is not always increment by 1.
And I would like to insert the CLNT table from temp table as per below code in SQL
Code:
MERGE INTO dbo.CLNT AS target
USING dbo.temp AS source
ON target.FRST_NAME = source.NAME
and target.UPDT_S = source.DATE_D
WHEN MATCHED THEN
UPDATE SET target.UPDT_S = source.DATE_D
WHEN NOT MATCHED BY TARGET THEN
INSERT (FRST_NAME, UPDT_S)
VALUES (source.name, source.Date_D);
How would i do this simple command in teradata?
Thank you guys,