This will do what you want:
INSERT INTO table2 (st_id,uid,changed,status,assign_status)
SELECT st_id,from_uid,now(),'Pending','Assigned'
FROM table1
If you want to include all rows from table1. Otherwise you can add a WHERE
statement to the end if you want to add only a subset of table1
.
More Related Contents:
- In MySQL, can I copy one row to insert into the same table?
- How to copy a row and insert in same table with a autoincrement field in MySQL?
- MySQL: Cloning a MySQL database on the same MySql instance
- how to delete data from table A besides the customer service and director data in table B?
- Get records with max value for each group of grouped SQL results
- How to store multiple options in a single table?
- How to populate a table with a range of dates?
- Get the new record primary key ID from MySQL insert query?
- How to Perform an UPSERT so that I can use both new and old values in update part
- brew install mysql on macOS
- TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT maximum storage sizes
- MySQL: multiple tables or one table with many columns? [closed]
- How do I check to see if a value is an integer in MySQL?
- Add 2 hours to current time in MySQL?
- Can MySQL replace multiple characters?
- My MySQL trigger doesn’t work, simple syntax, not complicated
- Using ORDER BY and GROUP BY together
- How can VBA connect to MySQL database in Excel?
- Select a column with a keyword name
- Sum results of a few queries and then find top 5 in SQL
- ERROR 1356 (HY000): View ‘mysql.user’ references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
- Use Composite Primary Key as Foreign Key
- How long is the SHA256 hash?
- how to trim leading zeros from alphanumeric text in mysql function
- Correct way to keep pooled connections alive (or time them out and get fresh ones) during longer inactivity for MySQL, Grails 2 app
- MySQL: Setting sql_mode permanently
- What are the max number of allowable parameters per database provider type?
- MySQL: how to index an “OR” clause
- Is it possible to count two columns in the same query
- mySQL query to search all tables within a database for a string?