0

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.

Hero981
  • 3
  • 3

1 Answers1

0

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)
NexusDB Expert
  • 301
  • 2
  • 3
  • Thanks! It worked! I did this first, but it didn't work, so maybe I was doing something wrong ... – Hero981 Dec 23 '20 at 06:56