I have a sample data like this. What I need is that, for every two rows in which 0 <= A value difference <= 1, (e.g. 0 <= row1.A - row1.B <=1 ) drop duplicates values by B and C, keep the smaller A row. Can this be done in Hql without using user defiend functions?
A B C
1 2 3
4 2 3
2 1 1
3 1 1
2 2 3
3 0 2
Results:
A B C
1 2 3
2 1 1
3 0 2
4 2 3