Ver Mensaje Individual
  #6 (permalink)  
Antiguo 21/01/2010, 11:20
Avatar de flaviovich
flaviovich
 
Fecha de Ingreso: agosto-2005
Ubicación: Lima, Peru
Mensajes: 2.951
Antigüedad: 18 años, 9 meses
Puntos: 39
Respuesta: max con where

Prueba asi:
Código SQL:
Ver original
  1. SELECT C.id, C.saldo
  2. FROM CAJA C
  3. INNER JOIN (
  4.     SELECT MAX(id) id
  5.     FROM CAJA
  6.     WHERE idSucursal = 1
  7. ) T ON C.id = T.id
__________________
No repitamos temas, usemos el Motor de busquedas
Plantea bien tu problema: Ayúdanos a ayudarte.