I have the following table :
X Y Z T
__________________
A 2
B 5 Z is UNIQUE
C 8
A 3
B 6
A 4
C 1
I want reduce the table to the following one according to Z values;
X Y Z T
__________________
A 2
A 3
A 4
B 5
B 6
how can I want construct table as follows ?
difference btw 3 and 2 is 1, and PK, i.e X, are same so take “A 2” and “A 3”
difference btw 4 and 3 is 1, and PK, i.e X, are same so take “A 4” and “A 3”
difference btw 6 and 5 is 1, and PK, i.e X, are same so take “B 6” and “B 5”
how can I do that ?
1 Answer