The basic question is if it's possible to create an INSERT operation using a SELECT statement as the source, rather than selecting individual records, pulling them out of the Salesforce database into a large buffer array and then performing an insert() on each one to push it back into the Salesforce database. It might look something like this:
INSERT INTO ClassEnrollment (StudentName, ClassName) SELECT StudentName, 'GYM' FROM Students WHERE FitnessScore >= 10
The reason I'm looking for this kind of bulk insert statement is to avoid governer limits if there are tens of thousands of records. In other databases a bulk insert statement like this is vastly more efficient than trying to insert thousands of records individually.
As a bonus is there a way to do this dynamically, like database.query(), so that the statement can be constructed at runtime instead of being fixed?