max a écrit :
> 
> hi all,
> I'm in trouble trying to create a sql query to get the prev & next value not
> null starting from a specified point ... I mean:
> 
> table_a
> 
> id
> ----
> 23
> 24
> 56
> 62
> 
> starting from id 56, I need the id 24 & the id 62 ... I've trying several
> way & mysql funct to do this job but w/o success :(
> 
> anyone can help me, plz?
> 
> many thanks in advance
> max
> 

Hi,

I haven't found a solution with a single query but with 2 queries you can do:

select max(id) from table_a where id<56;
select min(id) from table_a where id>56;

Regards
--
Joseph Bueno
NetClub/Trader.com

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to