EDIT: simplified further and fixed <vs <= error.
There is no floating point and work in every database that I have access to:
create table calls (t1 int, t2 int, rct int, cd int) insert into calls (t1, t2, rct, cd) values (60, 10, 48, 60) insert into calls (t1, t2, rct, cd) values (60, 10, 65, 70) insert into calls (t1, t2, rct, cd) values (60, 10, 121, 130) insert into calls (t1, t2, rct, cd) values (30, 20, 25, 30) insert into calls (t1, t2, rct, cd) values (30, 20, 35, 50) insert into calls (t1, t2, rct, cd) values (30, 20, 65, 70)
Result:
t1 t2 rct cd CalceCD
----------- ----------- ----------- ----------- ------ -----
60 10 48 60 60
60 10 65 70 70
60 10 121 130 130
30 20 25 30 30
30 20 35 50 50
30 20 65 70 70
60 10 70 70 70
(6 row (s) affected)
You could freely create a function like UDF or whatever your SQL environment allows you to clear the selection.
Edit: yes, gender and the offset of one avoids floating math.