| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Christian Mack | Date: | June 11 1999 4:50pm |
| Subject: | Re: Simple thing that i should probably know ... | ||
| View as plain text | |||
Jim Faucette wrote: > > Ed Williams wrote: > > > > I have two identical tables with one column > > all i want to do is merge them into one big table. > > and get rid of the duplicates at the same time... > > any ideas?? > > oh yeah the column names are identical in both tables but this can be changed. > > > > CREATE table3 col_name same_def_as_others NOT NULL PRIMARY KEY; > INSERT INTO table3 SELECT DISTINCT col_name FROM table1; > INSERT INTO table3 SELECT DISTINCT col_name FROM table2; > > jim... Nope :) Because table1 could contain a row identical to one in table2 use this: CREATE table3 col_name same_def_as_others NOT NULL PRIMARY KEY; INSERT INTO table3 SELECT DISTINCT col_name FROM table1; REPLACE INTO table3 SELECT col_name FROM table2; Tschau Christian
| Thread | ||
|---|---|---|
| • Simple thing that i should probably know ... | Ed Williams | 11 Jun |
| • Re: Simple thing that i should probably know ... | Jim Faucette | 11 Jun |
| • Re: Simple thing that i should probably know ... | Christian Mack | 11 Jun |
| • Re: Simple thing that i should probably know ... | Jim Faucette | 11 Jun |
| • Re: Simple thing that i should probably know ... | Christian Mack | 11 Jun |
| • Re: Simple thing that i should probably know ... | Vora Jinesh Udaykumar | 12 Jun |
| • keeping the whole database in the main memory... | Vora Jinesh Udaykumar | 12 Jun |
| • RE: Simple thing that i should probably know ... | Scott Cole | 12 Jun |
| • Re: Simple thing that i should probably know ... | Benjamin Pflugmann | 12 Jun |
