| | |
Nested insert queries in a single query
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
•
•
hi ,
I have four different tables, all are linked together using foreign key relationships.
Now i need to insert data in to the tables.How can i use nested insert queries to insert data by a single query?
SQL Syntax (Toggle Plain Text)
START TRANSACTION INSERT INTO blah... INSERT INTO blah... COMMIT
If one of your statements causes an error none will be committed so you won't get corrupted data / missing keys etc.
Note to self... pocket cup
![]() |
Similar Threads
- SQL Queries help (Database Design)
- database connection(select ,insert query) within javascript function (JSP)
- Moving database to new server (MySQL)
- Insert Into (PHP)
- MySql multiple table query problem.... (MySQL)
- using asp array to store db information (ASP)
- MySQL nested query / joined query conversion help (MySQL)
Other Threads in the MySQL Forum
- Previous Thread: speed of insert into a MySQL db
- Next Thread: Database and web design
| Thread Tools | Search this Thread |
Tag cloud for MySQL
1 agplv3 alfresco api artisticlicense aws bizspark breathalyzer camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright court crm data database design developer development distinct dui eliminate email enter enterprise error eudora facebook form foss gnu government gpl greenit groupware hiring hyperic images innerjoins insert ip joebrockmeier join keyword keywords kickfire laptop law legal license licensing linux maintenance managing mariadb matchingcolumns metron microsoft microsoftexchange montywidenius multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opengovernment opensource operand oracle penelope php query referencedesign reorderingcolumns results resultset saas search select sharepoint simpledb sourcecode spotify statement sugarcrm syntax techsupport thunderbird transparency update virtualization





