Question: I want to select from my FileList all different files using group by. But I want to get Back only the elements with the highest id. I only get the first entry back. 
How to fix this?

```
select * from files group by name;

```

This is my table-content...

```
 ID      NAME          DATE               USER 
1443 - /test.txt - 24 May 2013 12:56:15 - XX
1444 - /test.txt - 24 May 2013 12:54:41 - XX
1445 - /test.txt - 24 May 2013 12:53:38 - AB
1446 - /test.txt - 24 May 2013 12:44:32 - XX
1983 - /asdf.txt - 24 May 2013 13:46:32 - KS

```

Answer: 
```
select * from files 
where id in
(
  select max(id)
  from files
  group by name
)

```

or

```
select f.* 
from files f
inner join 
(
  select max(id) as id
  from files
  group by name
) x on x.id = f.id

```

[SQLFiddle demo](http://sqlfiddle.com/#!2/c25eb/1)
--------------------------------------------------
Use this:-

```
select *,max(id) from files group by name;

```