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

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -