简体   繁体   中英

NexusDB for each loop / substitute

I need a little push up. I have a temporary table created from a select.

Now I need to go through that table and for each record in that table I need to do insert to other table with some values from this temporary tables.

Anyway I can't figure out any way how to do it in NexusDB.

Simply I want to do this in nexusdb sql:

foreach(record in table1){
  insert into table2 (columns) values record.id, record.name ... etc.
}

I hope it does make sense to you guys and I look forward to some beautiful ideas of yours.

Thanks.

NexusDB does not need "foreach", you can do it like this:

insert into temp1 (field_2, field_3) (SELECT field_2, field_3 FROM temp2)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM