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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:39:34+00:00 2026-06-05T21:39:34+00:00

Actually I am stuck in middle of some mysql code. Can anyone suggest a

  • 0

Actually I am stuck in middle of some mysql code. Can anyone suggest a simple question. I have 6-10 (multiple) tables in a database all having different data means not related to each other.

There is no relation between tables, but have posted time inserted in each of the columns of all the tables. All I want is query all the tables sorted by timed column.

Eg:
table1:

recipename | cook | timetocook | dated (auto posted time - php time())
-----------+------+------------+------
abc        | def  |        100 | 10
zxy        | orp  |        102 | 16

table2:

bookname | author | dated (auto posted time - php time())
---------+--------+------
ab       | cd     | 11
ef       | nm     | 14

As you can see there is no relation between the table (I have read about joins), I want to show data one by one according to the posted time asc to desc.

like this:

abc  def  100  10
ab   cd   11
ef   nm   14
zxy  orp  102  16

So any help…to achieve this ???

  • 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-05T21:39:36+00:00Added an answer on June 5, 2026 at 9:39 pm
    SELECT recipename, cook, timetocook, dated 
    FROM table1
    UNION 
    SELECT bookname, author, dated, NULL
    FROM table2
    ORDER BY dated
    

    You have to add NULL value to make sure the column counts is the same the order tables.

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

Sidebar

Related Questions

I have stuck to manage the contextmenu after the right click . Actually I
I'm stuck with a task I thought simple, and hope it's actually simple :)
I'm stuck with a strange bug in my code. Actually I modified legacy code
NOTE: This is actually a database of a forum. I am stuck in an
Ok, I'm a bit stuck on this one, can I actually do what I'm
Actually i am get stuck in a big problem..I have created an app from
I have been stuck with this for a while now, Actually I have 2
I am stuck at user registration, I actually intends to have different profile types.
I am actually stuck in merging the result of this two queries: first query:
These are my initial days of working on BackBone.js. I am actually stuck with

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.