in reply to Re^2: Calculating previous/next from database
in thread Calculating previous/next from database
Only if this could work ...
-- changed "union" to "union all" select id from table where id > ? order by id asc limit 1 UNION ALL select id from table where id < ? order by id desc limit 1
... does not work in Sybase for (a) "order by" clause does not go with "union all" or in derived table creation; (b) there is no "limit" clause, just "rowcount" option per SQL session/transaction.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Calculating previous/next from database
by psini (Deacon) on May 31, 2008 at 12:10 UTC |