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 6999387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:32:04+00:00 2026-05-27T20:32:04+00:00

I have 2 tables on which I am doing a full outer join.Both the

  • 0

I have 2 tables on which I am doing a full outer join.Both the tables have a timestamp column. I want the result of the join to be ordered by the timestamp. such that say table a has rows

Table A

X           timestamp           
92408413    12/22/2011 11:23:36 AM  
92408414    12/22/2011 11:23:40 AM
92408417    12/22/2011 11:23:45 AM
92408419    12/22/2011 11:23:49 AM
92408423    12/22/2011 11:23:55 AM
92408424    12/22/2011 11:23:57 AM
92408426    12/22/2011 11:24:01 AM
92408427    12/22/2011 11:24:09 AM
92408430    12/22/2011 11:24:33 AM
92408435    12/22/2011 11:25:03 AM
92408437    12/22/2011 11:25:13 AM
92408497    12/22/2011 11:31:09 AM
92408498    12/22/2011 11:31:10 AM
92408499    12/22/2011 11:31:12 AM

table B

Y               X                timestamp
5020926963  92408430    12/22/2011 11:24:33 AM
5020926968  92408435    12/22/2011 11:25:03 AM
5020926970  92408435    12/22/2011 11:25:05 AM
5020926972  92408437    12/22/2011 11:25:14 AM
5020926981  -1      12/22/2011 11:31:09 AM
5020926982  -1      12/22/2011 11:31:10 AM
5020926984  92408499    12/22/2011 11:31:12 AM

Now if my query looks something like

SELECT * 
FROM   tablea 
       FULL OUTER JOIN tableb 
         ON tablea.x = tableb.x 
            AND tablea.w = tableb.w 
WHERE  tablea.x = 'somevalue' 
        OR tableb.x = 'somevalue' 
ORDER  BY tablea.timestamp, 
          tableb.timestamp  

The result of the query is :

92408413    12/22/2011 11:23:36 AM      
92408414    12/22/2011 11:23:40 AM      
92408417    12/22/2011 11:23:45 AM      
92408419    12/22/2011 11:23:49 AM      
92408423    12/22/2011 11:23:55 AM      
92408424    12/22/2011 11:23:57 AM      
92408426    12/22/2011 11:24:01 AM      
92408427    12/22/2011 11:24:09 AM      
92408430    12/22/2011 11:24:33 AM  5020926963  12/22/2011 11:24:33 AM
92408435    12/22/2011 11:25:03 AM  5020926968  12/22/2011 11:25:03 AM
92408435    12/22/2011 11:25:03 AM  5020926970  12/22/2011 11:25:05 AM
92408437    12/22/2011 11:25:13 AM  5020926972  12/22/2011 11:25:14 AM
92408497    12/22/2011 11:31:09 AM      
92408498    12/22/2011 11:31:10 AM      
92408499    12/22/2011 11:31:12 AM  5020926984  12/22/2011 11:31:12 AM
                                5020926981      12/22/2011 11:31:09 AM
                                5020926982  12/22/2011 11:31:10 AM

Now, this query first orders by TableA’s tiemstamp and then TableB’s. I want the result to be odered by timestamp(in order of time).So basically ordering by (TableA.timestamp + TableB.timestamp). As you can see there is a row in Table A where the timestamp is
‘ 92408497 12/22/2011 11:31:09 AM’
I want the next row in the result to have a column from Table B which has the same timestamp
‘ 5020926981 -1 12/22/2011 11:31:09 AM’

I am on a Oracle 11.2 database.

Thanks,

  • 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-05-27T20:32:05+00:00Added an answer on May 27, 2026 at 8:32 pm
    order by coalesce (table1.timestamp, table2.timestamp)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables which I want to join together using a left outer
I have two tables on which I am unable to perform full outer join
I have a MySQL Left Join problem. I have three tables which I'm trying
I want to find out which tables have been modified in the last hour
I have a table that was doing a fine job of full-text search until
I have two data tables which have a primary key column in common but
I have 2 tables which in simplified form look like this: Products( id: int,
I have two tables which looks something like this Table Queue int ID; string
I have two tables which are used to store details of different types of
I have two tables which have some transactional stuff stored in them. There will

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.