Web Analytics Made Easy -
StatCounter Simple Query... - CodingForum

Announcement

Collapse
No announcement yet.

Simple Query...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Simple Query...

    Hi

    I have a simple question...

    I have two tables...(the tables contain some duplicate entries)

    I need to combine them and then delete the records that occur more than once....this means not leaving any entry for the duplicate...

    Is there any simple way to do this?

    Thanks,

    Matt

  • #2
    Probably. Hard to say without knowing anything about the two tables or the info that's in them.

    Comment


    • #3
      Hi,

      the two tables are identical in stricture, columns for Client Number, First Name, Last Name, Address,

      The data is identical if there are duplicates...

      Thanks,

      Matt

      Comment


      • #4
        use "select unique" as the subselect input
        Last edited by cf2sg; Aug 2, 2005, 11:09 PM.

        Comment


        • #5
          You can make a third table with the same columns and use a UNION to populate it with the data from both of your existing tables:

          Code:
          INSERT INTO newtable
          SELECT client_number,first_name,last_name,address FROM oldtable1
          UNION DISTINCT
          SELECT client_number,first_name,last_name,address FROM oldtable2

          Comment

          Working...
          X