Glad that helped!
-M
----- Original Message ----- 
From: "Dan Jones" <[EMAIL PROTECTED]>
To: "MySQL Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, August 21, 2003 5:46 PM
Subject: Re: Copying distinct data to a new table


> On Thu, 2003-08-21 at 20:09, Dan Jones wrote:
> > I'm attempting to normalize a database that was originally created as a
> > flat file.  I want to extract distinct values from a table and insert
> > them as new entries into a new table.  Unless I'm missing something,
> > INSERT doesn't allow you to SELECT data from another table for
> > insertion, and UPDATE doesn't allow you to create new rows.
> > 
> > I could do a SELECT DISTINCT INTO OUTFILE, then LOAD DATA INFILE but
> > that seems rather cumbersome.  Is there a straightforward way to do
> > this?
> 
> Sheesh.  Nevermind.
> 
> INSERT INTO table (column) SELECT DISTINCT column2 FROM table2;
> 
> If you want to figure something out yourself, post a question to a
> mailing list.  You'll find the answer within 30 seconds of hitting
> "SEND."
> 
> 
> 
> 
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to