MySQL Forums
Forum List  »  Newbie

Re: Kind of BETWEEN
Posted by: Nick Roper
Date: August 31, 2004 03:16PM

Thomas,

Assuming you are using version 4.0 +, then try something like:


(SELECT num FROM numbers
WHERE num < 1100
ORDER BY num DESC
LIMIT 2)
UNION
(SELECT num FROM numbers
WHERE num > 1100
ORDER BY num ASC
LIMIT 2)
ORDER BY num;




--
Nick Roper

Options: ReplyQuote


Subject
Written By
Posted
August 31, 2004 01:51PM
Re: Kind of BETWEEN
August 31, 2004 03:16PM
September 01, 2004 12:09AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.