Question: I currently have a situation where I have to find the next value after my current move. 

Currently I have below:

```
 SELECT CONVERT(CHAR(17), PlannedStartDateUTC,13) 
 FROM   VisitMovement VM 
 WHERE  vm.VisitMovement_GUID = (SELECT VM2.VisitMovement_GUID 
                                 FROM VisitMovement VM2 
                                 WHERE vm2.OrderIndex = (VisitMovement.OrderIndex +10) 
                                   AND VM2.Visit_GUID = VisitMovement.Visit_GUID )) AS [Estimated Move],

```

Which works by using `VisitMovement.OrderIndex` to find the next move. However, in some situations the `OrderIndex` might not be +10 but +20. 

I can't understand how I would logically write this to find the next move.

Any more information please get in touch.

Answer: 
If your own hostname resolves to 127.0.0.1 (In my case, the hostname was in /etc/hosts), zookeeper won't start up without having 0.0.0.0 in the zoo.cfg file, but if your hostname resolves to the actual machine's IP, you can put it's own hostname in the config file.
We faced the same issue , for our case the root cause of the problem is too-many number of client connections . The default ulimit on aws ec2 instance is 1024 and this causes zookeeper nodes not able to communicate with each other . 

The fix for this is 
change the ulimit to a higher number -> (> ulimit -n 20000 )
stop and start zookeeper.