
October 11th, 2012, 01:07 PM
|
|
Registered User
|
|
Join Date: Oct 2012
Posts: 1
Time spent in forums: 20 m 41 sec
Reputation Power: 0
|
|
|
Need Help with 'MAX' switch
Hello, I want to retrieve from two tables a username plus the latest date they created something to evaluate for removal from the system. Here is my toad query:
Code:
SELECT DISTINCT USERS.DFULLNAME, REVISIONS.DCREATEDATE
FROM CP1DEV.USERS, CP1DEV.REVISIONS
Where REVISIONS.DDOCAUTHOR = USERS.DNAME with ur;
I have oracle experience not db2. Does max or something work similarly to return on ly the latest date? Please demonstrate. Thank you!
a bit later now...and this seems to work ok.
Code:
SELECT MAX(DATE(REVISIONS.DCREATEDATE)), USERS.DFULLNAME
FROM CP1DEV.USERS, CP1DEV.REVISIONS
Where REVISIONS.DDOCAUTHOR = USERS.DNAME
GROUP BY USERS.DFULLNAME with ur;
|