SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2001
    Location
    Helston, Cornwall, England
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Combining unrelated tables

    Hi,

    I currently have an existing property database and I have started importing property data from another website. Their information is in a totally different format (fields, comma delimited) than mine, so I have created separate tables for their data.

    I now have unrelated tables for each set of properties.

    The issue I came across was displaying a list of combined properties on a property search, both theirs and mine, so having looked around on google decided to carry out a select on each set of tables and then insert the results into a temporary table which I use to show the combined results. This works, but I'm wondering if there is a better way or what drawbacks this method has?

    Thanks for any advice.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,336
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    if you can insert the results of different SELECTs into the same temporary table, then you can use those same SELECTs in a UNION query to avoid the temp table altogether
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2001
    Location
    Helston, Cornwall, England
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Rudy, I'll do that.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •