• Ed Wagner (8/21/2014)


    I don't see what you're after either. Good job posting consumable DDL and sample data. Could you please explain the logic behind how you get the output you're trying to produce?

    Well the logic is to traverse through Coke/Fanta to HardDrink. In Between this if you find Pepsi Display it if not then dont display it. If there are multiple entries of Pepsi between (Coke or Fanta) to HardDrink then display the one which is latest, which we can find out with the help of createdDate column.