The Teradata Database channel includes discussions around advanced Teradata features such as high-performance parallel database technology, the optimizer, mixed workload management solutions, and other related technologies.
Below is the query and sample data for an airline project.The below records are sequence of a LEG_ID (PLANE hardware) with different flight nos which operate throught out the day from one source to destination.
Here there are 3 flights,790 flight travles from source LAX to destination YYZ ,794 flight from LAX to YYZ ,458 flight from YYZ to YYW.
Here only record 790 and 458 are valid as 1st flight starts at 13.15 (LEG_SCHD_DEP_TME) and lands at 17:50:00 (LEG_SCHD_DEP_TME) at YYZ.so next flight should start from YYZ which is at 20:10 pm.
But record flight no 794 is invalid as the flight starts at 15:00 which cannot be the case as 790 starts at same destination but different time .Is there some wat to eliminate this record.
Else is there some query where based on previous arrival time this record can be eliminated from the result set.