INSERT INTO tr_user_product_doctor (
user_id,
product_id,
doctor_id
) SELECT
user_id,
product_id,
‘doctorId‘
FROM
tr_product_user trpu
WHERE
trpu.user_id = ‘userId‘
说明:根据user_id 查询到相关的product_id,然后将其和后台传来的userId、doctorId传入tr_user_product_doctor 表中