How to avoid multiple insert in PostgreSQL

后端 未结 2 1470
醉梦人生
醉梦人生 2021-01-26 16:36

In my query im using for loop. Each and every time when for loop is executed, at the end some values has to be inserted into table. This is time consuming because for loop has m

2条回答
  •  醉话见心
    2021-01-26 17:10

    If you show how the variables are calculated it could be possible to build something like this:

    insert into datas.tb
    select
        calculate_j_here,
        calculate_predicted_node_here
    from generate_series(1, 10000)
    

提交回复
热议问题