Jump to content

[SOLVED] Getting data from 2 identically fielded tables.


woolyg

Recommended Posts

Hi all,

 

Ive got 2 tables, both of which have exactly the same field names, but different data in the tables. I want to get name 3 fields in my mySQL query, and get data to display from both tables:

 

Table 1:

 

-------------------------------------------------

| House_Name |   House_Desc | Date_Added |

-------------------------------------------------

| MyHouse | Lovely              | 27-08-2006 |

| YourHouse | NotLovely | 17-06-2007 |

-------------------------------------------------

 

 

Table 2:

 

-------------------------------------------------

| House_Name |   House_Desc | Date_Added |

-------------------------------------------------

| OldHouse | Horrid              | 07-08-2006 |

| NewHouse | Warm | 02-06-2007 |

-------------------------------------------------

 

 

 

I would like to set up a query with the result showing 3 fields, sorted by date:

 

RESULT:

 

-------------------------------------------------

| House_Name |   House_Desc | Date_Added |

-------------------------------------------------

| NewHouse | Warm | 02-06-2007 |

| YourHouse | NotLovely | 17-06-2007 |

| OldHouse | Horrid              | 07-08-2006 |

| MyHouse | Lovely              | 27-08-2006 |

 

 

Can anyone help?

The result set I'm getting is basically the two tables side by side, depending on which join type I use. I'd like to combine the results into 3 neat fields...

 

Cheers,

Woolyg

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.