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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:12:07+00:00 2026-06-13T05:12:07+00:00

I have 2 Tables. 1.Message – Sender_Number,SMS,DateTime. 2.Replies – Receiver_Number,SMS,DateTime. I want to combine

  • 0

I have 2 Tables.

1.Message - Sender_Number,SMS,DateTime.
2.Replies - Receiver_Number,SMS,DateTime.

I want to combine all the Columns and merge the 2 DateTime Columns into one Column and order by the time.

For example:

Messages Table:
123 | Hello there. | 2012-10-22 3:50
121 | HI I like U..| 2012-10-22 9:10

Replies Table:
123 | how are u... | 2012-10-22 5:50
121 | HI I like U2 | 2012-10-22 9:30

DESIRED OUTPUT (In 1 table):
123 | Hello there. | 2012-10-22 3:50 
123 | how are u... | 2012-10-22 5:50 
121 | HI I like U..| 2012-10-22 9:10 
121 | HI I like U2 | 2012-10-22 9:30 
  • 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-13T05:12:09+00:00Added an answer on June 13, 2026 at 5:12 am
    SELECT *
    FROM
    (
        SELECT col1, col2, col3 FROM messages
        UNION ALL
        SELECT col1, col2, col3 FROM replies
    ) x
    ORDER BY col3
    

    SQLFiddle Demo

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

Sidebar

Related Questions

hi i have two tables namely sms(Message,sms_index...columns) c_paid_bribe(c_addi_info,....) what i want to do is
I have two tables, a message table and a log table. I want to
I have 2 tables: Message: id: INT created_at: DATETIME Comment: id: INT message_id: INT
I feel totally stupid. I'm rusty with my sql. I have two tables, Message
Let's say I have 2 tables, Message and Product. Whenever a user post a
Okay I have three tables that all communicate with each other. ForumTopic t ForumMessage
I have two tables users registered_members I want to confirm values from user table
I have a database named bbs, which have 37 tables. I want to find
I have a following problem. I have three tables: message, comment and user. I
I have 2 tables containing information that I want to search for, a main

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.