On Fri, 2006-08-04 at 17:14 -0700, Tanner Postert wrote:
> select text from table where user = 2 and id < 3 order by id ASC limit 1;
> select text from table where user = 2 and id > 3 order by id ASC limit 1;
> 
> is it possible to do this using 1 query?

select text from table 
where user = 2 and id < 3 order by id ASC limit 1
UNION ALL
select text from table 
where user = 2 and id > 3 order by id ASC limit 1;


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to