![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
28/06/2010, 14:11
|
Colaborador | | Fecha de Ingreso: marzo-2008 Ubicación: Cáceres
Mensajes: 3.735
Antigüedad: 16 años, 10 meses Puntos: 300 | |
Respuesta: Obtener registro anterior y siguiente.. SELECT (
SELECT numerofactura
FROM tutabla
WHERE numerofactura < 29
ORDER BY numerofactura DESC
LIMIT 1
) AS anterior, (
SELECT numerofactura
FROM tutabla
WHERE numerofactura >29
ORDER BY numerofactura ASC
LIMIT 1
) AS posterior |