List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:July 23 2001 4:57pm
Subject:Re: joining tables
View as plain text  
At 11:57 AM -0400 7/23/01, Jeremy Morano wrote:
>Hi,
>
>I would like to know how to create a field that comes from another table and
>how to insert values from a table into another one.
>
>kind of like this
>
>table_1
>uid1 ...(primary key)
>first_name ...
>last_name ...
>
>craete table table_2 (
>uid2...(primary key)
>phone...
>fax...
>table_1.uid1 ...);
>
>insert into table_2
>(phone,fax,???????)
>values
>("999-9999", "555-5555", ????????);
>
>Please replace the ???????......................thanx


Use INSERT INTO tbl_name .... SELECT:

http://www.mysql.com/doc/I/N/INSERT_SELECT.html

-- 
Paul DuBois, paul@stripped
Thread
joining tablesJeremy Morano23 Jul
  • Re: joining tablesPaul DuBois23 Jul
  • sorryPessin24 Jul