mysql - Copying data from one table to another with additional columns -
i want put data 1 table table, 1 constant number.
i have 2 tables, party , partyrole(two columns partyid , roleid).
i want put id of party table constant role i.e. 10 in partyrole table.
is below query right ?
insert partyrole (partyid, 10) select partyid parties
is below query right ?
insert partyrole (partyid, 10) select partyid parties
the answer no
instead try query
insert partyrole (partyid, roleid) select partyid, 10 parties
Comments
Post a Comment