List:General Discussion« Previous MessageNext Message »
From:SGreen Date:July 7 2004 4:57pm
Subject:Re: mysql sql question
View as plain text  
Bruce,

It also depends on where the data is coming FROM as to what your options
are. Is the source data coming from another table (like, maybe from a bulk
import?)  or from some kind of user input?

You CAN write it in one statement but I need to know your data source.

Yours,
Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine


|---------+---------------------------------->
|         |           "Peter Brawley"        |
|         |           <peter.brawley@artfulso|
|         |           ftware.com>            |
|         |                                  |
|         |           07/04/2004 06:03 PM    |
|         |                                  |
|---------+---------------------------------->
 
>--------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                       
                                        |
  |       To:       <bedouglas@stripped>, <mysql@stripped>        
                                                    |
  |       cc:                                                                             
                                        |
  |       Fax to:                                                                         
                                        |
  |       Subject:  Re: mysql sql question                                                
                                        |
 
>--------------------------------------------------------------------------------------------------------------------------------|




Bruce,

>i have two hypothetical tables
>create table owner (
>    -> name char(20) ,
>    -> ownerid int(10) auto_increment primary key);

>create table dog (
>    -> name char(20) ,
>    -> ownerid int(10),
>    -> dogid int(10) auto_increment primary key);

>i'm curious as to how i'd go about inserting a name and the id of the
owner,
>in table "dog", in a single sql statement.

>something like this psuedo sql..
> insert table (name, ownerid) values ($name, $ownerid)
>   where owner.owner = owner

INSERT INTO takes a single table arg, so to insert int o2 tables,you need
editable Views (not yet in MySQL) or at least Stored Procedures (MySQL
version 5) on the server side, or you can, as you suggest, do it in the
app.

PB





Thread
date and time functions.Hari Yellina4 Jul
Re: date and time functions.Eric Bergen4 Jul
  • mysql sql questionbruce4 Jul
    • Re: mysql sql questionPaul DuBois4 Jul
      • RE: mysql sql questionbruce5 Jul
    • Re: mysql sql questionPeter Brawley6 Jul
RE: mysql sql questionbruce5 Jul
  • RE: mysql sql questionbruce5 Jul
RE: mysql sql questionQuentin Bennett5 Jul
  • RE: mysql sql questionbruce5 Jul
RE: mysql sql questionQuentin Bennett5 Jul
  • RE: mysql sql questionbruce5 Jul
    • mysql sql files...bruce5 Jul
      • RE: mysql sql files...bruce5 Jul
      • Re: mysql sql files...Paul DuBois5 Jul
    • Re: mysql sql questionJohn Hicks5 Jul
Re: mysql sql questionSGreen7 Jul