Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Query to get Max (Date)
You don't need to group by the created column (at the end of the group by
clause).
-- Niall Litchfield Oracle DBA Audit Commission UK ***************************************** Please include version and platform and SQL where applicable It makes life easier and increases the likelihood of a good answer ****************************************** "Mike Haig" <zzz_at_postmaster.co.uk> wrote in message news:ea1237b2.0202070933.1f1c052a_at_posting.google.com...Received on Fri Feb 08 2002 - 06:25:33 CST
> Sorry, I didn't explain myself fully in my first posting. This is the
> full query I'm running -- at the bottom is the result I'm expecting..
>
> Thanks!
> Tony
>
> ----------------
>
>
> SELECT DISTINCT
> RTRIM(DMSG.FORUMNAME) AS TOPICS,
> RTRIM(DMSG.ADMINSMTPADDRESS) AS ADMINSMTP,
> RTRIM(DMSG.GROUPNAME) AS
> DFGROUP,
> RTRIM(DMSG.AUTHORSMTPADDRESS) AS AUTHORSMTP,
> MAX(DMSG.CREATED) AS LASTPOSTED
> FROM DISCUSSIONMESSAGES
> DMSG,
> DISCUSSIONGROUP DFG,
> DISCUSSIONFORUM DF
> WHERE DF.ADMINSMTPADDRESS=DMSG.ADMINSMTPADDRESS AND
> DF.NAME=DMSG.FORUMNAME AND
> DFG.ACCESSLEVEL='all' AND
> DMSG.INTRANETNAME='EMEAGWW' AND
> DMSG.SERVICE='Discussionboards' AND
> DMSG.DOCFUNCTION='Discussionboards' AND
> DMSG.GROUPNAME='Creative101'
> GROUP BY DMSG.FORUMNAME,
> DMSG.ADMINSMTPADDRESS,
> DMSG.GROUPNAME,
> DF.ADMINSMTPADDRESS, DMSG.CREATED
>
>
> And the result should be as follows
>
> AUTHORSMTP | TOPICS | LASTPOSTED