sql - what is the best and fastest way to get the row number -
suppose have data in below format in table, have fetch decile, best , fastest query in sql server correct decile.
suppose have 2 parameters in scalar function,
- performancevalue
- measureid
suppose pass 11.22 in performance value parameter , 3 in measureid, scalar function should return 3
suppose pass 85.54 in performance value parameter , 4 in measureid returns 10
suppose pass 54.00 in performance value parameter , 4 in measureid return 7.2
the table need contains measureid
, number range (e.g from_value
, till_value
) , decile
. use simple where
clause:
select decile mytable measureid = 4 , 54.00 between from_value , till_value;
Comments
Post a Comment