mysql how to create new row for selected group -


i have tables partners, publications, baskets, etc. i'd add publication every partner in selected basket.

every table connect keys, not sure, have join them (partner.partner_id, publications.pb_partner_id, baskets.bsk_partner_id).

i tried isn't enough:

insert publications(pb_id, timestamp, comment)  values (1, 2017, 'whatever')  (select partner_id  partner join basket on partner_id = b_partner_id b_partner_id in basket_id = 13; 

yes, i'm full beginner in, may simple, dont speak english enough.

use insert ...select in following way:

insert publications(pb_id, timestamp, comment) (select 1, 2017,partner_id partner join basket on partner_id = b_partner_id  basket_id = 13); 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -