Hi...
it is actually sql (mariadb) question...
I have a table with those values:
id | name | points
---------------------------
0 | george | 5
1 | nick | 10
2 | gregory | 10
3 | nick | 10
4 | nataly | 10
5 | george | 10
6 | nick | 10
7 | george | 5
8 | nataly | 5
I want to get three last values and only from unique name values (and more specific for george,nick,gregory) order by DESC;...
so i think that this:
So this return to me three unique and specific... but gets firsts id (or what sql finds more faster) ... not in mind the order by id...
anyone can help for ORDER BY AND GROUP together ???
thanks in advance
it is actually sql (mariadb) question...
I have a table with those values:
id | name | points
---------------------------
0 | george | 5
1 | nick | 10
2 | gregory | 10
3 | nick | 10
4 | nataly | 10
5 | george | 10
6 | nick | 10
7 | george | 5
8 | nataly | 5
I want to get three last values and only from unique name values (and more specific for george,nick,gregory) order by DESC;...
so i think that this:
SELECT * FROM (select * from exampletable where name in ('george,'nick','gregory') order by id DESC) as t group BY name LIMIT 3;
So this return to me three unique and specific... but gets firsts id (or what sql finds more faster) ... not in mind the order by id...
anyone can help for ORDER BY AND GROUP together ???
thanks in advance