Antiselect Function Example | Teradata Vantage - 17.05 - Antiselect Example: No Column Ranges - Teradata Database

Teradata Vantage™ - Advanced SQL Engine Analytic Functions

prodname
Advanced SQL Engine
Teradata Database
vrm_release
17.00
17.05
created_date
June 2020
category
Programming Reference
featnum
B035-1206-170K

Input

The input table, antiselect_test, is a sample set of sales data containing 13 columns.

antiselect_test
sno id orderdate priority qty sales disct dmode custname province region custsegment prodcat
1 3 2010-10-13 00:00:00 Low 6 261.54 0.04 Regular Air Muhammed MacIntyre Nunavut Nunavut Small Business Office Supplies
49 293 2012-10-01 00:00:00 High 49 10123 0.07 Delivery Truck Barry French Nunavut Nunavut Consumer Office Supplies
50 293 2012-10-01 00:00:00 High 27 244.57 0.01 Regular Air Barry French Nunavut Nunavut Consumer Office Supplies
80 483 2011-07-10 00:00:00 High 30 4965.76 0.08 Regular Air Clay Rozendal Nunavut Nunavut Corporate Technology
85 515 2010-08-28 00:00:00 Not specified 19 394.27 0.08 Regular Air Carlos Soltero Nunavut Nunavut Consumer Office Supplies
86 515 2010-08-28 00:00:00 Not specified 21 146.69 0.05 Regular Air Carlos Soltero Nunavut Nunavut Consumer Furniture
97 613 2011-06-17 00:00:00 High 12 93.54 0.03 Regular Air Carl Jackson Nunavut Nunavut Corporate Office Supplies

SQL Call

SELECT * FROM Antiselect (
  ON antiselect_test
  USING
  Exclude ('id', 'orderdate', 'disct', 'province', 'custsegment')
) AS dt ORDER BY 1, 4;

Output

sno priority qty sales dmode custname region prodcat
1 Low 6 2.61540000000000E 002 Regular Air Muhammed MacIntyre Nunavut Office Supplies
49 High 49 1.01230000000000E 004 Delivery Truck Barry French Nunavut Office Supplies
50 High 27 2.44570000000000E 002 Regular Air Barry French Nunavut Office Supplies
80 High 30 4.96576000000000E 003 Regular Air Clay Rozendal Nunavut Technology
85 Not specified 19 3.94270000000000E 002 Regular Air Carlos Soltero Nunavut Office Supplies
86 Not specified 21 1.46690000000000E 002 Regular Air Carlos Soltero Nunavut Furniture
97 High 12 9.35400000000000E 001 Regular Air Carl Jackson Nunavut Office Supplies