0% found this document useful (0 votes)
7 views2 pages

Netezza SQL Table Management Guide

The document compares SQL syntax for various conditions (Exists, Not Exists, IN, Not IN) and operations (Delete, Truncate, Update) between SQL Server and Netezza databases. In SQL Server, these are implemented using standard SQL syntax, while in Netezza some additional steps like creating temporary tables are required to perform the equivalent operations.

Uploaded by

shameeram
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLS, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Netezza SQL Table Management Guide

The document compares SQL syntax for various conditions (Exists, Not Exists, IN, Not IN) and operations (Delete, Truncate, Update) between SQL Server and Netezza databases. In SQL Server, these are implemented using standard SQL syntax, while in Netezza some additional steps like creating temporary tables are required to perform the equivalent operations.

Uploaded by

shameeram
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLS, PDF, TXT or read online on Scribd

CONDITION SQL SERVER NETEZZA

Exists Select * from Tab1 A Select * from Tab A


Where Exists (Select 1 Left Outer Join Tab B
From Tab2 B On A.col1 = B.col1
Where A.col1 = B.col1) Where B.col1 is not null
Not Exists Select * from Tab1 A Select * from Tab A
Where Not Exists (Select 1 Left Outer Join Tab B
From Tab2 B On A.col1 = B.col1
Where A.col1 = B.col1) Where B.col1 is null
IN Select * from Tab1 A Select * from Tab A
Where IN (Select 1 Left Outer Join Tab B
From Tab2 B On A.col1 = B.col1
Where A.col1 = B.col1) Where b.col1 is not null
Not IN Select * from Tab1 A Select * from Tab A
Where Not IN (Select 1 Left Outer Join Tab B
From Tab2 B On A.col1 = B.col1
Where A.col1 = B.col1) Where b.col1 is null
Delete Delete from Tab1 A Create Table Tmp_Tab1
where A.col1 is null as Select * from Tab1
where A.col1 is not null
Drop Table Tab1
Alter Table Tmp_Tab1 Rename to Tab1
Truncate Truncate table Tab1 Create Table Tmp_Tab1
as Select * From Tab1
where 1=2
Drop Table Tab1
Alter Table Tmp_Tab1 Rename to Tab1
Update Update Table Tab1 Create Table Tmp_Tab1
Set Col1 = 10 as Select 10 as Col1,
where Col1 is Null Col2,
-----
Coln
from Tab1
where Col1 is Null
Create Table Tmp_Tab2
as select * from Tab1 A
Left Outer Join Tmp_Tab1 B
On A.Col1 = B.Col1
where B.Col1 is null
Insert into Tmp_Tab1
select * from Tmp_Tab2
Drop table Tab1
Drop table Tmp_Tab2
Alter Table Tmp_Tab1 Rename to Tab1

You might also like