It is not clear what you have done wrong. Because the 2 sentences are exactly equivalent and work perfectly well.
TOP 1
in SQL Server:
create table tbl (
id int not null primary key,
texto varchar(50) not null
);
insert into tbl (id, texto) values (1, 'aaa');
insert into tbl (id, texto) values (5, 'eee');
insert into tbl (id, texto) values (2, 'bbb');
insert into tbl (id, texto) values (4, 'ddd');
insert into tbl (id, texto) values (3, 'ccc');
select top 1 *
from tbl
order by id desc;
Result:
id texto
-- -----
5 eee
Demo
LIMIT 1
with MySQL
create table tbl (
id int not null primary key,
texto varchar(50) not null
);
insert into tbl (id, texto) values (1, 'aaa');
insert into tbl (id, texto) values (5, 'eee');
insert into tbl (id, texto) values (2, 'bbb');
insert into tbl (id, texto) values (4, 'ddd');
insert into tbl (id, texto) values (3, 'ccc');
select *
from tbl
order by id desc
limit 1;
Result:
id texto
-- -----
5 eee
Demo
As you can see, both queries work well and return the same result.
On the other hand, the query that you put as the answer to your question:
SELECT MAX(id) *
FROM Tabla
... is not valid at all, it does not even run, as you can see here: Demo
Maybe you wanted to say:
SELECT MAX(t.id), t.*
FROM Tabla t
... but although at least now it runs, this query can give you completely erroneous results, as you can see in the following demo:
create table tbl (
id int not null primary key,
texto varchar(50) not null
);
insert into tbl (id, texto) values (1, 'aaa');
insert into tbl (id, texto) values (5, 'eee');
insert into tbl (id, texto) values (2, 'bbb');
insert into tbl (id, texto) values (4, 'ddd');
insert into tbl (id, texto) values (3, 'ccc');
select max(t.id), t.*
from tbl t;
Result:
max(t.id) id texto
--------- -- -----
5 1 aaa
Demo