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.

I can easily do this in two queries:
select ... where recorddate < thisdate order by date desc limit 1
select ... where recorddate > thisdate order by date asc limit 1

Any ideas?

- Ken
[EMAIL PROTECTED] 

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