Copy row and all of its 'children'

后端 未结 2 1156
小鲜肉
小鲜肉 2021-01-21 06:07

I have a MySQL table called employees. There\'s another table called shifts that is tied to employees by the employeeId colum

2条回答
  •  渐次进展
    2021-01-21 06:27

    Yes but not with a single insert.

    You'd have one INSERT to do the employee, then a second INSERT with a sub-SELECT to SELECT all of the shift data.

    Here are some examples

提交回复
热议问题