hi all...

 i have an issue with group by and ordering. apparently group by ignores
'order by id DESC'?!

 an example is a table that has an id and a category fields. there are a
few categories under which records can be filed. so what i want is the
latest record from each category by doing something like:

select id, name from table group by category order by id DESC;

this doesn;t work - it shows me the first record under each category - not
the latest as specified by DESC?! something is wrong.

i tried 'distinct' but that 'distincts' on all fields in the query?!?! 
whats the point of distinct if it can not distincts between fields?! in:

select distinct category, id, name from table order by id DESC;

this query distincts on all category, id and name when it should distinct
only on category....

how do i do that without temporary tables?

thanks...



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to