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
>
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
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]
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
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
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
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