I am new to teradata. I have a requirement where i have to write two adjacent rows in a table as a row in a new table.
Can somebody please help me.
My source table:
Target table should look like this:
Try this Query, i think it will work...
sel t.Col,tt.Col from (sel Col, row_number() over(order by Col) RN from Tablename)t
(sel Col, row_number() over(order by Col)-1 RN1 from Tablename)tt
In another 2 method,
1. select c1,min(c1)over(order by c1 rows 1 following and 1 following) as c2 from table qualify c2 is not null;
2. select c1,coalesce(min(c1)over(order by c1 rows 1 following and 1 following),'No adjacent cell') as c2 from