Hello I am trying to do a select of certain elements on a table.
here is what my table look like
Time,UsrerId,Data.
Now what i want to do is for the same userid i want the first and last Value of data according to the timestamp.

Example: 

```
Time UserID Data 
8 PM 1 200 
9 PM 1 300 
10 PM 1 100 
8 PM 2 150 
9 PM 2 250 
10 PM 2 350 
8 PM 3 100 

```

So my result should look like: 

```
8 PM 1 200 
10 PM 1 100 
8 PM 2 150 
10 PM 2 350 
8 PM 3 100 

```