imstillatwork
IS-IT--Management
Hello!
Can I get a random single row withing the top 10% of a numeric field in a single query??
I was thinking something like
select name, value
from table
where value > (
select min(value) FROM table order by value DESC LIMIT 10 - but I want 10%, not 10 rows
)
order rand()
LIMIT 1
What to do?
Kevin
Can I get a random single row withing the top 10% of a numeric field in a single query??
I was thinking something like
select name, value
from table
where value > (
select min(value) FROM table order by value DESC LIMIT 10 - but I want 10%, not 10 rows
)
order rand()
LIMIT 1
What to do?
Kevin