Re: DISTINCT and ORDER (not a new NBC TV show)

2004-08-17 Thread SGreen
ROFLMAO -- Yep! It's been one of _those_ days!!! Shawn Michael Stassen <[EMAIL PROTECTED]> wrote on 08/17/2004 05:10:46 PM: > Just a minor quibble: You don't need DISTINCT here, because the GROUP BY > will ensure distinct results. Probably just another fast-typing symptom. > > Michael >

Re: DISTINCT and ORDER (not a new NBC TV show)

2004-08-17 Thread Michael Stassen
Just a minor quibble: You don't need DISTINCT here, because the GROUP BY will ensure distinct results. Probably just another fast-typing symptom. Michael [EMAIL PROTECTED] wrote: oops! - typing too fast for my own good. The fixed query should have been: SELECT DISTINCT E.Title, E.ID, max(C.Date

Re: DISTINCT and ORDER (not a new NBC TV show)

2004-08-17 Thread Ron Gilbert
Thanks, that did the trick. On Aug 17, 2004, at 12:34 PM, [EMAIL PROTECTED] wrote: -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: DISTINCT and ORDER (not a new NBC TV show)

2004-08-17 Thread SGreen
oops! - typing too fast for my own good. The fixed query should have been: SELECT DISTINCT E.Title, E.ID, max(C.DateAdded) as maxdate FROM Entries E, Comments C WHERE C.EntryID = E.ID GROUP BY E.Title, E.ID ORDER BY maxdate desc LIMIT 10 8-D Shawn [EMAIL PROTECTED] wrote on 08/17/2004 03:26:53

Re: DISTINCT and ORDER (not a new NBC TV show)

2004-08-17 Thread SGreen
I don't think the engine is messing up here. I think you are getting exactly what you asked for and I will explain why I think that. You are asking for 3 things from 2 tables: Entries.ID , Entries.Title , Comments.DateAdded. If Entry #1 was called "My First Thread" and h

Re: DISTINCT and ORDER (not a new NBC TV show)

2004-08-17 Thread Michael Stassen
Ron Gilbert wrote: I am trying to run this query... select distinct E.Title, E.ID, C.DateAdded from Entries E, Comments C where C.EntryID = E.ID order by C.DateAdded desc limit 10 ...to get the last 10 entries that had comments added to them, but the DISTINCT is not returning distinct results. Wh

DISTINCT and ORDER (not a new NBC TV show)

2004-08-17 Thread Ron Gilbert
I am trying to run this query... select distinct E.Title, E.ID, C.DateAdded from Entries E, Comments C where C.EntryID = E.ID order by C.DateAdded desc limit 10 ...to get the last 10 entries that had comments added to them, but the DISTINCT is not returning distinct results. What I get is 10 entr