SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2005
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What type of statement do I need here?

    Hello, first I apologize if this has been answered already. I couldn't find the answer I need by doing a forum search.

    Anyway, I have two similar tables. They both contain the same fields and some of the records may be identical. My question is what type of select statement do I need to use to find all of the records from both tables and not have any duplicates in the results. I have tried several different methods and none have returned the results that I need.

    Is this even possible?

    Thanks

  2. #2
    SitePoint Zealot
    Join Date
    Dec 2005
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Never mind. I think I need a UNION statement here. At least, I THINK that's it.

  3. #3
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    you could do it with a union if you're on mysql 4.1 or newer. otherwise a left join is called for.


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
  •