Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8717761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:22:18+00:00 2026-06-13T06:22:18+00:00

I have the following fields: user_id, app_mod, profile, update_date . The first three fields

  • 0

I have the following fields: user_id, app_mod, profile, update_date.
The first three fields can be duplicated (i.e. two rows could have user_id, app_mod and profile equals, but different update_date):

user_id   app_mod  profile update_date
560047    RI03290   22809   14-GEN-10  
560047    RI03290   22809   18-GEN-10

How can I get the one row with higher update_date in an Oracle environment?

560047    RI03290     22809   18-GEN-10
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T06:22:19+00:00Added an answer on June 13, 2026 at 6:22 am

    If the table really only has 4 columns

    SELECT user_id, app_mod, profile, max(update_date)
      FROM table_name
     GROUP BY user_id, app_mod, profile
    

    If the table has other columns as well that you’re not including and that will not be duplicated that you do want returned

    SELECT *
      FROM (SELECT a.*,
                   rank() over (partition by user_id, app_mod, profile
                                    order by update_date desc) rnk
              FROM table_name a)
     WHERE rnk = 1;
    

    The analytic function rank will assign multiple rows the same rank if there are ties (i.e. the two rows have the same user_id, app_mod, profile, and update_date). You could use row_number instead which would arbitrarily break the tie. But that would not generally be a repeatable process– Oracle might pick one of the two rows today and another row tomorrow. If you were looking for rows other than the most recent row, you might also look at dense_rank but that will behave identically to rank if you’re just looking for the most recent row.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables in a SQLite DB, and both have the following fields:
I have a model: ChatStatus with the following fields (ID, user_id, status, thread_id) What
Say I have a 'user_log' table with the following field: id user_id status_text timestamp
I have a model with the following fields: user = models.ForeignKey(User) impact = models.IntegerField(default
I'm using CakePHP 2.1 I have following fields in database. id views max_views I
If I have the following fields in a table called DailyLeaveLedger LeaveDate LeaveType AmountPaid
Good day, If I have for example the documents which have the following fields
I have following databases: test table1 fields: id, password, name, lastname test2 table2 fields:
I have a SQL table with following fields ID, Rly, Shed, Loco_no, shed, Date_failure,
I have a table called Employee with the following fields: EmpID Salary Name I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.