List:General Discussion« Previous MessageNext Message »
From:Travis Ard Date:February 11 2011 1:01am
Subject:RE: function to limit value of integer
View as plain text  
Maybe some sort of logarithmic expression?

select no_of_jobs, 10 * log(10, no_of_jobs) as job_weight
from data;

Of course, you'd have to tweak your coefficients to match the weighting
system you want to use.


-----Original Message-----
From: Richard Reina [mailto:gatorreina@stripped] 
Sent: Thursday, February 10, 2011 3:07 PM
To: mysql@stripped
Subject: function to limit value of integer

Is there a function that can limit the value of an integer in a MySQL
query?   I am trying to write a query that scores someones experience.
However, number of jobs can become overweighted in the the query below. If
someone has done 10 jobs vs. 1 that's a big difference in experience. But
someone who's done 100 vs. someone who's done 50 the difference in
experience is not so great as they are both near the top of the learning
curve.  In essence number of jobs becomes less and less of a contributor as
it increases. Is there a way to limit it's value as it increases?

SELECT years_srvd + no_of_jobs AS EXPERIENCE



function to limit value of integerRichard Reina10 Feb
  • RE: function to limit value of integerTravis Ard11 Feb
    • Re: function to limit value of integerRichard Reina11 Feb
      • Re: function to limit value of integerJohan De Meersman11 Feb
        • Re: function to limit value of integerPhilip Riebold11 Feb