Does anyone know if I can construct my insert/select statement this way
instead:

INSERT INTO wow.resume_erp
( field1, field2, etc)
INSERT INTO wow.candidate_erp
( field1, field2, etc)
SELECT SQL_CALC_FOUND_ROWS *
FROM wow.resume r
INNER JOIN wow.candidate c
WHERE r.Section_ID = '1'
AND MATCH (r.Section_Value)
AGAINST ('+BAAN' IN BOOLEAN MODE)
AND c.Candidate_ID = r.Candidate_ID


-----Original Message-----
From: Peter Lovatt [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 14, 2004 1:29 PM
To: [EMAIL PROTECTED]; Mysql
Subject: RE: Copying rows based on query result to another table?


try

INSERT INTO other_table
( field1, field2, etc)
SELECT SQL_CALC_FOUND_ROWS *
FROM wow.resume r
INNER JOIN wow.candidate c
WHERE r.Section_ID = '1'
AND MATCH (r.Section_Value)
AGAINST ('+BAAN' IN BOOLEAN MODE)
AND c.Candidate_ID = r.Candidate_ID

Peter

> -----Original Message-----
> From: Eve Atley [mailto:[EMAIL PROTECTED]
> Sent: 14 September 2004 18:18
> To: Mysql
> Subject: Copying rows based on query result to another table?
>
>
>
> I want to copy rows of data from a query result to another table. How do I
> accomplish this? Here's my example for further explanation...
>
> I have 2 tables, candidate and resume. I have 2 other (currently empty)
> tables, exact duplicates, candidate_erp and resume_erp. In resume_erp will
> be duplicates from resume that contain 'ERP' (Enterprise Resource
> Planning)
> keywords, ie. BAAN, SAP, Peoplesoft, and more. In candidate_erp
> will be the
> associated 'candidate' rows. When I construct my SQL query and
> run it, I can
> successfully view the resulting query which contain the keyword BAAN. How
> can I then copy those results into candidate_erp?
>
> A query example...
>
> SELECT SQL_CALC_FOUND_ROWS *
> FROM wow.resume r
> INNER JOIN wow.candidate c
> WHERE r.Section_ID = '1'
> AND MATCH (r.Section_Value)
> AGAINST ('+BAAN' IN BOOLEAN MODE)
> AND c.Candidate_ID = r.Candidate_ID
>
> I notice that MySQL CC and MySQL Query Browser both have the ability to
> export to a file (ie. CSV), but it doesn't appear they will import neatly
> into the tables candidate_erp and resume_erp.
>
> Thanks in advance,
> Eve
>
>
>
> --
> 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