MySQL Forums
Forum List  »  Newbie

Complicated Insert Statement
Posted by: Chris Pfeffer
Date: May 25, 2012 08:30AM

I have a department table with 15 selected rows
select dept from depttable
Accounting
Business
IT

I have a people table with about 60 people in them
select peopleID from peopletable
1
2
3

What I want to do is insert the information in the following table:
peopleID – dept
So that I have
peopleID dept
1 Accounting
1 Business
1 IT
1 …
2 Accounting
2 Business
2 IT
2 …
… …

Any ideas how to do the SQL or if it’s even possible to do this with SQL?

Options: ReplyQuote


Subject
Written By
Posted
Complicated Insert Statement
May 25, 2012 08:30AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.