0
I have table Customer_address_tx having structure below..

cust_id_pk      BIGINT
comm_fk         BIGINT

Now I want to update comm_fk with null where comm_fk is zero, Such records lies in range 280000000 to 320000000(cust_id_pk)

在上述范围内,有 500 万条这样的记录 comm_fk=0 我想用 null 更新

My Update query

db2 "更新 Customer_address_tx set comm_fk=null where comm_fk =0"

为了有效地运行上面的查询,我将上面的更新语句分成多个更新语句,根据每个5000的范围 280000000 到 320000000(cust_id_pk)

db2 "update Customer_address_tx set comm_fk=null where comm_fk =0 and cust_id_pk 在 280000000 和 280005000 之间"

db2 "update Customer_address_tx set comm_fk=null where comm_fk =0 and cust_id_pk 在 280005001 和 280010000 之间"

. . . .

以上是正确的方法..?

欢迎任何其他方法...

4

0 回答 0