Question: How can I select the row with the highest ID in MySQL? This is my current code:

```
SELECT * FROM permlog WHERE max(id)

```

Errors come up, can someone help me?

Answer: 
Suppose you have mulitple record for same date or leave\_type but different id and you want the maximum no of id for same date or leave\_type as i also sucked with this issue, 
so Yes you can do it with the following query:

```
select * from tabel_name where employee_no='123' and id=(
   select max(id) from table_name where employee_no='123' and leave_type='5'
)

```
This is the only proposed method who actually selects the whole row, not only the max(id) field. It uses a subquery

SELECT \* FROM permlog WHERE id = ( SELECT MAX( id ) FROM permlog )