SQL-MapReduce Call - Aster Analytics

Teradata Aster Analytics Foundation User Guide

Product
Aster Analytics
Release Number
6.21
Published
November 2016
Language
English (United States)
Last Update
2018-04-14
dita:mapPath
kiu1466024880662.ditamap
dita:ditavalPath
AA-notempfilter_pdf_output.ditaval
dita:id
B700-1021
lifecycle
previous
Product Category
Software

This call finds the employees who report to employee 100 (either directly or indirectly) by traversing the tree of employees from employee 100 downward.

SELECT * FROM ntree (
  ON employee_table PARTITION BY 1
  Root_Node (mgr_id IS NULL)
  Node_ID (emp_id)
  Parent_ID (mgr_id)
  Starts_With (emp_id=100) 
  Mode ('down') 
  Output ('end')
  Result (PATH(emp_name) AS path)
) ORDER BY 1;