我的任务是更新数据库中的几行。有两列,其中一列是ID,另一列是CURRENCY。我已经使用下面的更新语句更新了这些行:
update account set currency = 'INR' where id =15;
update account set currency = 'EURO' where id =12;
update account set currency = 'DOLLAR' where id =18;
update account set currency = 'Pound' where id =13;
-- and so on.
Run Code Online (Sandbox Code Playgroud)
实际上,在这种情况下,由于行数相对较少,我可以使用这些更新语句轻松完成,但是如果有数千或数十万行怎么办?这是更新它们的唯一方法,还是有其他方法或脚本?
使用以下查询时,我无法从 bnrcno 列中获取数据。
select 'insert into table values('||id||','||bnrcno||','||chargetype||','||domno||','||coa_id||','||liability_gl||','||revenue_gl||','||taxno||')'
from bill_charges_map where domno=5
Run Code Online (Sandbox Code Playgroud)
该brcno列是整数类型,其中的大多数值都为空。