Example: P_INTERSECT Function - Analytics Database - Teradata Vantage

SQL Date and Time Functions and Expressions

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-10-30
dita:mapPath
cpk1628111786971.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
pxz1544241488545
lifecycle
latest
Product Category
Teradata Vantageā„¢

In the following example, the P_INTERSECT operator is used in the selection list.

SELECT period2 P_INTERSECT period1 
FROM product_tests 
WHERE pid = 11804;

Assume the query is executed on the following table product_tests where period1 is a PERIOD(TIME(1)) column and period2 is a PERIOD(TIME(0)) column:

pid     period1                        period2
-----   ----------------------------   ------------------------
11804   ('10:10:10.1', '11:10:10.1')   ('10:10:10', '10:10:11')
10996   ('11:10:10.1', '11:40:40.1')   ('10:10:10', '10:10:11')

The result is as follows:

(period2 P_INTERSECT period1)
-----------------------------
('10:10:10.1', '10:10:11.0')