I have a db table like:
----------------------------
id name cat
============================
1 20.gif logo
2 21.gif logo
3 22.gif logo
4 15.gif web
5 16.gif web
6 17.gif web
7 23.gif logo
8 18.gif web
9 19.gif web
and I want to fetch highest (latest inserted record for each cat) some thing like:
----------------------------
id name cat
============================
7 23.gif logo
9 19.gif web
for this I queried:
SELECT id, name, cat FROM portfolio GROUP BY cat ORDER BY name DESC
but because name field is an string so I cant apply ORDER BY on name.
any idea..?