BTW, how precise the CTR populated with the statement above will be? I think I want the same precision as the rank. How to do that? Do I have to write 3 sql statements?
CTR is a double precision floating point field. It will have values between 0 and 1 inclusive based on the math described above. Rank is an integer value from 0 to 1000.