insert into with 2 joins?
I have 1 table auction_activity_notifications where need to insert id from
users table and the column item_watch , also need join email_templates
table and also need insert into auction_activity_notifications
I make this query where is inserting ID of user and item_watch column , i
need join email_templates and insert id from email_templates into
auction_activity_notifications
INSERT INTO auction_activity_notifications (id_user, id_target)
SELECT id, item_watch
FROM users AS u
LEFT JOIN auction_activity_notifications AS aa
ON u.id = aa.id_user
AND
u.item_watch=aa.id_target
i have these columns in auction_activity_notifications
and in the end i need insert current date into created_date_time
id_email_templates, id_user , id_target , created_date_time
No comments:
Post a Comment