MySQL, how to query among intervalls? -
its want for i
cycle. table:
amount value 1 1 4 10 9 11 14 12
and want 10 asking amount 5
. so, "test" results be:
1 => 1 2 => 1 3 => 1 4 => 10 5 => 10 6 => 10 7 => 10 8 => 10 9 => 11 10 => 11 11 => 11 12 => 11 13 => 11 14 => 12
but amount = 5 wont work. how set intervals?
is want?
select t.value table t t.amount <= 5 order t.amount desc limit 1;
Comments
Post a Comment