troubleshooting Question

How can Iinsert multiple records through loop in a table in MYSQL.

Avatar of puneetdudeja
puneetdudejaFlag for India asked on
10 Comments2 Solutions366 ViewsLast Modified:
If I have a table like::

TableName(X, Y, Z) and I have "Y" values in Table2(Y,P).
I want to insert one record in "TableName" table, for each value of "Y" in Table2, the remaining columns of "TableName' table having same values for all the inserted records except "Y" having different values which are from "Table2".

I don't know how to apply loops in mysql.

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros