If you have come from the Oracle database background then you will be confusing and frustrating to find there is no Netezza dual table. In Netezza you do not need one; believe me when I am saying you do not need dual in Netezza. When you are working on MPP appliance like Netezza, you can run your SQL queries or calculations without any dummy table i.e. dual table oracle.
Read:
- Netezza Alter Table Commands and Examples
- Netezza LIKE Statement and Pattern matching Examples
- IBM Netezza Split Delimited Fields into Table Records and Examples
In Netezza, ANSI SQL allows SELECT statements without a FROM clause, and hence there is no DUAL table.
For example:
TRAINING.ADMIN(ADMIN)=> select NOW(); NOW --------------------- 2016-12-01 20:23:01 (1 row) TRAINING.ADMIN(ADMIN)=> select 10+20 as SUM; SUM ----- 30 (1 row)
Netezza Dual Table Alternative
When migrating or sharing Oracle environments, you may have used the DUAL table to test the database connection or perform basic computations. You can use the Netezza system view _v_dual as an Oracle dual table alternative.
In the Netezza database, there is no DUAL table so you may want to use an equivalent alternative _v_dual system view that returns quickly (for JDBC connection pool testing) and avoids the normal overhead of a table selection.
Read:
- Netezza System Tables and system views
- Netezza Create Table Commands and Examples
- IBM Netezza String Functions and Examples
- Netezza pivot rows to column and example Pivot Table Examples
For Example;
TRAINING.ADMIN(ADMIN)=> select NOW() from _v_dual; NOW --------------------- 2016-12-01 20:24:24 (1 row) TRAINING.ADMIN(ADMIN)=> select 10+20 as SUM from _v_dual; SUM ----- 30 (1 row) TRAINING.ADMIN(ADMIN)=>