开发者

Insert into MySQL tables with JOIN?

开发者 https://www.devze.com 2022-12-18 19:52 出处:网络
I have these tables: My final mysql db, could someone check if the tables are correctly made? H开发者_高级运维ow can I make an Insertion of an ad here?

I have these tables: My final mysql db, could someone check if the tables are correctly made?

H开发者_高级运维ow can I make an Insertion of an ad here?

Is join used on insert also?

Thanks

Clarification: I need to insert values into multiple tables here, and don't know how to do it else than using multiple INSERT INTO statements.

So I wonder if there is anyway to make just ONE statement (one line) and use JOIN to INSERT?


As far as I'm aware of, you can't INSERT data into multiple tables Within one plain SQL statement.

There are many database abstraction frameworks out there which can do something like that (DOCTRINE TO THE RESCUE!!) but thats a whole other story.

SQL for it self it not capable of such things.


No it's not possible with an INSERT statement to insert into multiple tables. But you could use a stored procedure that would nicely batch the various inserts, and the application would have only one SQL command to emit.


I don't understand your first question about the ads. As for the second, JOIN will not be used on a standard table unless you are using it in an INSERT...SELECT statement, which you very likely aren't.

0

精彩评论

暂无评论...
验证码 换一张
取 消