insert/select for multiple tables...

2004-09-01 Thread bruce
hi... trying to figure out how to structure an insert/select for a multiple table situation... sort of... insert table1, table2 (table1.item1, table1.item2, table2.item1,...) select a.q1, b.q2 from a1 left join a2 on a2.t=a1.t where a2.r='4'; i can't seem to figure out the syntax for

Re: insert/select for multiple tables...

2004-09-01 Thread Michael Stassen
bruce wrote: hi... trying to figure out how to structure an insert/select for a multiple table situation... sort of... insert table1, table2 (table1.item1, table1.item2, table2.item1,...) select a.q1, b.q2 from a1 left join a2 on a2.t=a1.t where a2.r='4'; i can't seem to figure out the

RE: insert/select for multiple tables...

2004-09-01 Thread bruce
, September 01, 2004 10:06 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: insert/select for multiple tables... bruce wrote: hi... trying to figure out how to structure an insert/select for a multiple table situation... sort of... insert table1, table2 (table1.item1, table1

RE: insert/select for multiple tables...

2004-09-01 Thread Paul DuBois
At 10:52 -0700 9/1/04, bruce wrote: michael... it was meant as an example, to convey what i want to do, which is do a simltaneaous insert into multiple tables at the same time. the syntax concerning the left join/elements to be inserted was not intended to be syntacticly (sp?) correct!!! and as i

Re: insert/select for multiple tables...

2004-09-01 Thread Michael Stassen
Bruce, Sorry, I guess I wasn't clear. I understood what you were asking, and I thought I answered it. Your search of the mysql docs and google found nothing about multiple-table inserts because you can't do that. I think the mysql manual page I referenced is clear: INSERT Syntax INSERT

another insert/select for multiple tables... (or, determining previous auto-increment ID)

2004-09-01 Thread Eve Atley
The question: Is there anything in MySQL that will allow me to determine, accurately, the last auto-incremented field from a particular database, so I can then insert based upon this into another table? What if 2 users input at the same time? Please see the 'long explanation' for further

Re: another insert/select for multiple tables... (or, determining previous auto-increment ID)

2004-09-01 Thread SGreen
Since you should still have the same information that you used to create your entry in the candidate table you can do something like: SELECT @candidateID := Candidate_ID FROM candidate WHERE Last_Name = '$lastname' AND First_Name = '$firstname' AND Middle_Initial = '$middle'

Re: another insert/select for multiple tables... (or, determining previous auto-increment ID)

2004-09-01 Thread Michael Stassen
Yes, LAST_INSERt_ID(). It's connection-specific, not db-specific. Because it is connection-specific, your 2-users issue is avoided. See the manual for the details http://dev.mysql.com/doc/mysql/en/Getting_unique_ID.html. Michael Eve Atley wrote: The question: Is there anything in MySQL that