Ken writes:

> Query question:
> 
> Can anyone think of a way to accomplish this in a single query?:
> 
> I have a table with elements that each have a date.
> For a given record, I want to get, in one query, the record just earlier than this 
>record's date, and the record just later than this record's date.

Do it in two queries or be prepared to take a performance hit. 
Honestly I can't even think of a way to do it with just one query,
but looking into using SQL variables might help. I'm not sure, though.

//C

-- 
 Carl Troein - Círdan / Istari-PixelMagic - UIN 16353280
 [EMAIL PROTECTED] | http://pixelmagic.dyndns.org/~cirdan/
 Amiga user since '89, and damned proud of it too.


---------------------------------------------------------------------
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