List:General Discussion« Previous MessageNext Message »
From:Steve Edberg Date:January 14 2003 6:31pm
Subject:Re: Populating one table with data from another
View as plain text  
Use INSERT...SELECT syntax:

	http://www.mysql.com/doc/en/INSERT_SELECT.html

-steve


At 12:01 PM -0500 1/14/03, Michael Knauf/Niles wrote:
>Ok, this has got to be easy, but I'm not getting it right...
>
>
>I have a table, products containing a 944 rows. One of the fields is
>fgNumber,
>
>I have another table, categoryRelatedToProducts which also has an fgNumber
>field and currently has no data.
>
>I'd like to add all 944 fgNumbers to the categoryRelatedToProducts table.
>
>Can I do this with one sql statement?
>
>Michael
>


-- 
+------------------------------------------------------------------------+
| Steve Edberg                                      sbedberg@stripped |
| University of California, Davis                          (530)754-9127 |
| Programming/Database/SysAdmin               http://pgfsun.ucdavis.edu/ |
+------------------------------------------------------------------------+
| SETI@Home: 1001 Work units on 23 oct 2002                              |
| 3.152 years CPU time, 3.142 years SETI user... and STILL no aliens...  |
+------------------------------------------------------------------------+
Thread
Populating one table with data from anotherMichael Knauf/Niles14 Jan
  • Re: Populating one table with data from anotherPaul DuBois14 Jan
  • Re: Populating one table with data from anotherSteve Edberg14 Jan
  • Re: Populating one table with data from anotherGelu Gogancea14 Jan
  • Re: Populating one table with data from anotheriConnect \(Berlin\) Stefan Hinz14 Jan