Zend - Find number or the second largest number

How can i find second largest number in case i dont find the number i’ve searched?
for example
i am searching 3000 and on my db the largest number i’ve got is 2900 how can i find the second largest?

	
		$query = $select->from('numbers', array(
			'id'))
			->where('number=?',$big_number);

I’m pretty sure that this is what you’re asking for.

SELECT `number` FROM `table` WHERE `number` <= ? ORDER BY `number` DESC LIMIT 2;

Failing that, you maybe after this.

SELECT DISTINCT `number` FROM `table` WHERE `number` <= ? ORDER BY `number` DESC LIMIT 2;