Input -
Name|city |startyear
Rahul |Mumbai|2010
Rahul|kolkata|2014
Rahul|Delhi|2018
Output should be-
Name|city |startyear|endyear
Rahul |Mumbai|2010|2014
Rahul|kolkata|2014|2018
Rahul|Delhi|2018|9999
Answer / yash
We can use rollup to convert whole data in vector and later use vector data in normalize to assign last column.
rollup: use accumulation function on all columns
NORMALIZE:
length :: 3;
out::normalize(in,index)=
begin
out.name :: in.name[index];
out.city :: in.city[index];
out.startyear :: in.startyear[index];
out.endyear :: if(index==2) 9999 else in.startyear[index+1];
end;
| Is This Answer Correct ? | 0 Yes | 0 No |
Can you explain the co>operating system’s processing model?
Describe how you would ensure that database object definitions (tables, indices, constraints, triggers, users, logins, connection options, and server options etc)are consistent and repeatable between multiple database instances (i.e.: A test and production copy of a database)?
What is $mpjret?
How co> operating system natively processes the data?
What is the difference between look-up file and look-up, with a relevant example?
Explain PDL with an example?
What are the key elements of a data processing system?
Difference between output_index and output_indexes in reformat
what is the use of stdenv in abinitio and what the main concept belongs to is?what is env?
Can we specify checkpoints without Phases?
how does deadlock occur?
Hi friends, what are the new features in abinito3.0?