Ver Mensaje Individual
  #4 (permalink)  
Antiguo 20/07/2010, 09:39
Avatar de flaviovich
flaviovich
 
Fecha de Ingreso: agosto-2005
Ubicación: Lima, Peru
Mensajes: 2.951
Antigüedad: 18 años, 8 meses
Puntos: 39
Respuesta: ciclo ascendente y descendente

Una ayudita:
Código SQL:
Ver original
  1. DECLARE @flag bit
  2. DECLARE @contador INT
  3. DECLARE @direc INT
  4. DECLARE @TOP INT
  5.  
  6. SET @flag = 0
  7. SET @contador = 0
  8. SET @TOP = 8
  9. SET @direc = +1
  10.  
  11. while @flag = 0
  12. BEGIN
  13.     SET @contador = @contador + @direc
  14.     IF @contador < @TOP
  15.         SET @contador = @contador + 1
  16.     ELSE
  17.         SET @direc = @direc * -1
  18.    
  19.     IF <llego a limite>
  20.         SET @flag = 1
  21. END
__________________
No repitamos temas, usemos el Motor de busquedas
Plantea bien tu problema: Ayúdanos a ayudarte.