I'm having trouble writing the query that returns the last id by date of a table and fetching the name of that id from another table

```
SELECT l1.* 
FROM ficha_eventos l1 
INNER JOIN (SELECT l2.`SQ_FICHA`, MAX(l2.`id`) as maxid 
            FROM ficha_eventos l2 
            GROUP BY l2.`SQ_FICHA`
           ) l3 ON l3.maxid = l1.id 

```

**Result above**

```

2| 1 |2014-04-04 | ok
6| 2 |2014-04-04 | ok
4| 3 |2014-04-04 | ok

```

```

ficha_cadastro

SQ_FICHA|NOME|

1|gabriel
2|carlos
3|manuel

ficha_evento

id|dia_atendimento|ligacao_atendimento|SQ_FICHA

1 | 2011-01-01 | no | 1
2 | 2014-04-04 | ok | 1
3 | 2012-01-01 | no | 2
4 | 2013-03-03 | ok | 3
5 | 2013-01-01 | no | 3
6 | 2014-04-04 | ok | 2

```

**Result I want**

```

2|gabriel|2014-04-04 | ok
6|carlos|2014-04-04 | ok
4|manuel|2014-04-04 | ok

```