Tags for recursive
Consolidate rows
I'm looking to consilidate rows in my table by combining similar consecutive rows together.  In the example I have category "A" where the type "X" is the 1st two rows in order of START_TS. I need those two rows to combine with the start_TS from the 1st row and the END_TS of the second row. The other two rows would remain the same.
recursive
Find all parents for child
WITH RECURSIVE RECTBL(child_ID, child_nm, Parent_ID, Parent_NM, LVL)AS ( SELECT CHILDid, childname, PARENTID, parentname, 0 AS lvl FROM WDM_S_WCIS_GEN_S1.HIERARCHY WHERE CHILDid = 1 AND SNAP_EFF_DT = CURRENT_DATE - 1 UNION ALL SELECT CHILDid, childname, PARENTid,  parentname, RECTBL.LVL + 1 FROM RECTBL
recursive
When you give a calculated column the same alias as an existing column, how do you refer to the new value?
Normally when you define a column and give it an alias you can reference it in calculating another column:
recursive cte re-alias
Running Sum counter restart when threshold value reached
Hi All, I have a unique situation in that I have the following scenario: Cust      UID     Txn Amount      Running Sum Amount            indicator 1            a             10                        10                                      0
recursive threshold cross
Create Expiration Date based on next Date Value
I am looking to build and Effective Date and Expiration Date utilzing a customers next purchase date in the table without a do loop if possible as I do not have access to buid stored procedures. Below is an example of current data: ID          InvoiceDate ABC123  4/16/2015 ABC123  5/20/2015 ABC123  6/30/2015  
date recursive loop
Recursive Query Column length
Hi,  I am new to the recursive query. I was practicing on some sample data collected from the Internet. Here is my code: 
recursive column length auto-truncation
Recursive Query to List down the Lineage for a Particular Table with Immediate Parents
Hi All  I have require to list down the lineage for a particular table as below: Source --> Target1 Target1 --> Target2 Target1 --> Target 3 Target2 --> Target 4    
recursive
3707 error when using recursive 'with' in stored proc in an attempt to concatenate a field.
Hello Using version 15, I am stuck with 3707 error: [5526] SPL1027:E(L417), Missing/Invalid SQL statement'E(3707):Syntax error, expected something like an 'END' keyword between ';' and the 'with' keyword.'. Line 417 is the termination semicolon for a recursive query trying to concatenate a field:
recursive loop 3707 error concatenate
query to bring in multiple row values into one record
My data looks something like this: table1: ID | Line | Code 1 | 1 | a 1 | 2 | b 2 | 1 | d 2 | 2 | e 2 | 3 | f   table2: Code | Name a | alpha b | beta d | delta e | epsilon f | phi   A common join brings the following results: ID | Line | Name
teradata join recursive query help
Storing with recursive result set
Hi Guys,   i'm using 'With Recursive' to fetch required result set, i need to insert this result set into another table. Please let me know how we can do this. I tried below syntax, but it's not working,  with recursive <recursive_name> (select column list) as ( select * from seed table
capturing with recursive result set storing with recursive result set with recursive recursive

Pages