How to "Insert INTO ... SELECT"

I need to duplicate rows from a DB table.

Is there a way to do this using the Model?

In MySQL I’d use a




INSERT INTO myTable (cols) SELECT (cols) FROM myTable WHERE condition



I could use an active record find to select the data and then insert it, but this would be inefficient.

ActiveRecord is generally used for CRUD.

Your situation is a bit different.

So, you’d better go down to DAO.