Skip navigation links

MySQL Forums :: Newbie :: Complicated Insert Statement


Advanced Search

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 Chris Pfeffer 05/25/2012 08:30AM
Re: Complicated Insert Statement Peter Brawley 05/25/2012 01:45PM
Re: Complicated Insert Statement Chris Pfeffer 05/25/2012 01:55PM
Re: Complicated Insert Statement Chris Pfeffer 05/25/2012 02:01PM
Re: Complicated Insert Statement Peter Brawley 05/25/2012 02:22PM
Re: Complicated Insert Statement Chris Pfeffer 05/29/2012 07:25AM


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.