I have a mysql table like 

```
Name  |  age |     time
------+------+---------
x     |   23 | 21:00:01
y     |   67 | 23:34:43
z     |   90 | 12:45:34
a     |   45 | 21:10:10
b     |    3 | 23:45:00

```

Now I need to find the name and age for a input which has time just greater than the given input.

Say I have an input 21:00:01 then output will be 21:10:10. I can write this query but I have a huge list of inputs and every time I cannot execute a query for each input date.

What I need is a query which take the input list as input and return me the next big time against each inputs. I am stuck here any solutions please

I am trying to get the output like this when there is a where clause like time in ("21:00:01",...)

```
Name  |  age |     time  |    nexttime   |   nextname   |
------+------+-----------+---------------+---------------
x     |   23 | 21:00:01  | 21:10:10      | a
y     |   67 | 23:34:43  | 23:45:00      | b
z     |   90 | 12:45:34  | 21:00:01      | x
a     |   45 | 21:10:10  | 23:34:43      | y
b     |    3 | 23:45:00  |               |

```