What is the best sql join method to query 4 tables with same columns?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anfetienne
    Contributor
    • Feb 2009
    • 424

    #1

    What is the best sql join method to query 4 tables with same columns?

    What is the best sql join method to use when i want to join upto 4 tables that all have the same columns?
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Why would you have up to four tables with the exact same structure?

    If they are basically the same table, split into multiple parts, then the UNION command is probably best. It basically just ties the result set of one query to the end of another, return them as a single result set.

    If it is something more complex than that, you would have to do a normal join. We would need some more details to be able to help you with that.

    Comment

    • anfetienne
      Contributor
      • Feb 2009
      • 424

      #3
      the tables are for comments on a website... 1 table is for text status, 1 is for audio status, 1 is for text comments on a profile and 1 is for audio comments on a profile. they have to be stored seperately because the forms used have a certain code within them that generates a different id code according to each page and comment type. but there is one page where everything will need to be joined and displayed.

      Comment

      Working...