mysql - SQL Statement to copy rows of data -


so have table data shows users , assets own. each row different asset, there multiple rows 1 user. here's sample row:

sample row

my question statement have write copy multiple rows of data user 'aaronm' user 'kodym'? believe on thinking querys have tried, thought ask outside help. thank in advance replies.

this have right now:

 insert assets (username, assettag,      serialnumber, dept, category, itemdesc, model, issuedate, issuedby,      totalvalue, accessories, issuecondition,      notes, createby, createdate)      select @username2, assettag, serialnumber, dept, category, itemdesc, model,      issuedate, issuedby, totalvalue, accessories,      issuecondition, notes, createby, createdate assets username = @username  

you use insert . . . select:

insert t(user, . . . )  -- list of columns here     select 'kodym', . . .  -- values other columns     t     user = 'aaronm'; 

Comments

Popular posts from this blog

php - Cannot override Laravel Spark authentication with own implementation -

What is happening when Matlab is starting a "parallel pool"? -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -