Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Select MAX date from more than one field or query

user12149152Jun 9 2016 — edited Jun 10 2016

When synchronizing data between two or more databases, a date or timestamp field will be necessary to decide when (and sometimes in what direction) synchronizing is necessary.

In my case, we will also need to synchronize data from Oracle views to FileMaker tables (FileMaker operates best on local data, but has no concept of views). When the view is based upon more than one Oracle table, each of which has an UpdateTime field, the view ought to display the value from the table with the most recently updated relevant record.

The MAX() function does the trick when you want the max value from one field in one table. But:

Is there any function or otherwise prepared way to select the most recent updatetime between MAX(updatetime) query results from more than one table? (Not quite unlike the coalesce function, where you can list fields sequentially and pick the first non-NULL value.)

Or will I need to make my own PL/SQL function to handle this?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 8 2016
Added on Jun 9 2016
13 comments
22,662 views