I want to select rows which have a difference of more than 1 in OU_DEA
Hello everyone, I want to select rows which have a difference of more than 1 in OU_DEAL_ID column. Eg: There are 4 values, 202513,202515,202996, 202999. So I want to group 202513,202515 (put row tag as 1) and group 202996, 202999 (put row tag as 2) using lag operation, I am getting the DIFF for 202515, but not sure of how I can get the first row(202513). For this I can assign row_number ordering OU_DEAL_ID, but not sure of how I can do that in
5 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Rajanikant HawaldarRank #107 · 20.6K reputationPosted Jun 5, 2021, 6:10 AM EDT
Chandu K146 reputationPosted Jun 5, 2021, 7:41 AM EDT
Rajanikant HawaldarRank #107 · 20.6K reputationPosted Jun 6, 2021, 6:16 AM EDT
Chandu K146 reputationPosted Jun 7, 2021, 8:31 AM EDT
Rajanikant HawaldarRank #107 · 20.6K reputationPosted Jun 8, 2021, 7:29 AM EDT