I have a table that looks like the following but also has more columns that are not needed for this instance.

```
ID   DATE          Random
--   --------      ---------
1    4/12/2015     2
2    4/15/2015     2
3    3/12/2015     2
4    9/16/2015     3
5    1/12/2015     3
6    2/12/2015     3

```

ID is the primary key
Random is a foreign key but i am not actually using table it points to.

I am trying to design a query that groups the results by Random and Date and select the MAX Date within the grouping then gives me the associated ID.

IF i do the following query 

```
select top 100 ID, Random, MAX(Date) from DateBase group by Random, Date, ID

```

I get duplicate Randoms since ID is the primary key and will always be unique.

The results i need would look something like this

```
ID   DATE          Random
--   --------      ---------
2    4/15/2015     2
4    9/16/2015     3

```

Also another question is there could be times where there are many of the same date. What will MAX do in that case?