Det du leder efter er ret simpelt. For eksempel dette:
SELECT (1+1) AS sum1,(2+2) AS sum2
vil resultere i:
+------+------+
| sum1 | sum2 |
+------+------+
| 2 | 4 |
+------+------+
Alt du skal gøre er at sætte dine underforespørgsler derind:
SELECT (SELECT picsid
FROM pics
WHERE picsid < 136 AND
albid_pics = 15
ORDER BY picsid DESC
LIMIT 1) AS previous,
(SELECT picsid
FROM pics
WHERE picsid > 136 AND
albid_pics = 15
ORDER BY picsid ASC
LIMIT 1) AS `next`;
Bemærk:next
er et nøgleord i MySQL, deraf backticks.