How do I query for the most recent modified record?

Can someone help me to pull just the most recent modified record for a voter id.  I thought using max would do it but I am obviously wrong.  My query is below.

SELECT   JURISDICTIONS.NAME,
      VOTER_AUDITS.ID,
      VOTER_AUDITS.VTR_ID,
      MAX(VOTER_AUDITS.MODIFIED_DATE),
      VOTER_AUDITS.OLD_VALUE,
      VOTER_AUDITS.NEW_VALUE,
      VOTER_AUDITS.AUDTYP_ID
 FROM      JURISDICTIONS,VOTER_AUDITS, VOTERS
WHERE    JURISDICTIONS.CODE = VOTER_AUDITS.JS_CODE
  AND       VOTER_AUDITS.js_code ='46'
  AND       VOTER_AUDITS.AUDTYP_ID='7'
  AND       VOTER_AUDITS.VTR_ID = VOTERS.ID
GROUP BY JURISDICTIONS.NAME,
      VOTER_AUDITS.ID,
      VOTER_AUDITS.VTR_ID,
      VOTER_AUDITS.OLD_VALUE,
      VOTER_AUDITS.NEW_VALUE,
      VOTER_AUDITS.AUDTYP_I
restockettAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sdstuberCommented:
SELECT name,
       id,
       vtr_id,
       modified_date,
       old_value,
       new_value,
       audtyp_id
  FROM (SELECT jurisdictions.name,
               voter_audits.id,
               voter_audits.vtr_id,
               voter_audits.modified_date,
               voter_audits.old_value,
               voter_audits.new_value,
               voter_audits.audtyp_id,
               ROW_NUMBER()
                   OVER (PARTITION BY voter_audits.vtr_id ORDER BY voter_audits.modified_date DESC)
                   rn
          FROM jurisdictions, voter_audits, voters
         WHERE     jurisdictions.code = voter_audits.js_code
               AND voter_audits.js_code = '46'
               AND voter_audits.audtyp_id = '7'
               AND voter_audits.vtr_id = voters.id)
 WHERE rn = 1
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
restockettAuthor Commented:
Thanks, that works.  I have more questions about how to use this as a subquery for another query but i will enter as a new Question
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.