Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Query to get Max (Date)

Re: SQL Query to get Max (Date)

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Fri, 8 Feb 2002 12:25:33 -0000
Message-ID: <3c63c3c2$0$8506$ed9e5944@reading.news.pipex.net>


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

> 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
Received on Fri Feb 08 2002 - 06:25:33 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US