I have two tables: table_1 contains a post and table_2 contains all users mapped to post. now I would like to insert post into table1 and I will get a post_id, then I will insert all users who are mapped to post with user_id and post_id.
insert into `post_users_map` (`post_id`,`user_id`,`is_owner`)
select '12345', `user_id`, '0' from `users`
where username in ("A","B","C")
Now I would like to insert ("12345",'123',1) as another row along with select results.
Any suggestion is appreciated and Thanks in Advance.