@scotty_walker
You can use a subquery inside an interval function in Teradata by following the syntax below:
1 2 3 |
SELECT column_name FROM table_name WHERE date_column BETWEEN current_date - INTERVAL (SELECT interval_value FROM interval_table) DAY AND current_date |
In this example, the subquery is used to retrieve the interval value from a separate table. The subquery should return a single value that can be used as the interval in the INTERVAL function.