Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to write a function that looks up values from a table within a range?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 465
    Answer it

    In the database I have a table for Users, and one table that is used as lookup. it holds scores and values. 
    i.e

    10 5
    15 6
    20 7

    After form submission, on the Users table a value like 12 is persisted.
    What I need is, a function to get this value 12..Look it up on the table.. It falls in the range 10-14 which means it has a score of 5.
    I need to take this score and perform some calculations.
    What is the best way to do this ?
     

    public void Calculate ( long Id ) {
    
    //for that user id, get the value 12 using getters and check in the lookup table
    
    }

     

 0 Answer(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: