469,946 Members | 1,857 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,946 developers. It's quick & easy.

importing problem

I am changing my church band scheduling system from Excel to Database. I
have assigned a schedule table in MySQL database that will be my master
schedule. It contains the following fields:

eventid (refers to a field in my events table that contain dates
and types of events on that date)
playerid (refers to a field in my players table that contains a
list of my players)
instrumentid (refers to a field in my instruments table that contains a
list of instruments we use)
level (Lead or secondary player in your instrument)

I have imported my Excel file into a table (temp) so I can manipulate it
within MySQL it contains the following fields:

eventdate (date of event they are playing on. Corresponds to the
eventdate field in my events table)
nick (my designation for each player in Excel. I created a
corresponding field in the players table to help translate)

I need to insert into my schedule table the information from my temp table
changing the nick field into a playerid and changing the eventdate field
into an eventid. Below is my query that does not work. Instead of
inserting 209 rows (the number of records in my temp table) it inserts over
35000 rows.

INSERT INTO schedule (eventid, playerid)
SELECT p.id AS playerid, e.id AS eventid
FROM players AS p, events AS e
INNER JOIN temp AS t ON p.nick=t.nick
INNER JOIN temp ON e.eventdate=t.eventdate

How do I limit the records I want inserted to the records in my temp table?
Jul 19 '05 #1
0 1015

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by qwweeeit | last post: by
11 posts views Thread by Grim Reaper | last post: by
5 posts views Thread by dixie | last post: by
7 posts views Thread by Timothy Shih | last post: by
5 posts views Thread by hharriel | last post: by
reply views Thread by James Minns | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.