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

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

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -