Forum Discussion

Neha11's avatar
Neha11
Copper Contributor
Aug 08, 2022

Lead function

Hi everyone, 

 

I want to compare current row with all the other rows in the table

 

I have used lead function in case statement, 

But while setting an offset value it only takes a certain number , like lead(col name,2) , but I want the offset to be in certain range, becos I need to compare current row with all the other rows in tge table

 

Is there any way to achieve this?

 

Thanks & Regards,

Sonam Mathur 

 

 

  • olafhelper's avatar
    olafhelper
    Bronze Contributor
    That's to less on information.
    Please post table design as DDL, some sample data as DML statement and the expected result.

Resources