本文介绍了使用批量插入时插入空值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一张桌子:
CREATE TABLE cust ( cust_id NOT NULL, cust_name NOT NULL, address NULL );我必须将这些行插入另一个表:
I have to insert these rows into another table:
CREATE TABLE 1cust_det ( cust_id NOT NULL, cust_name NOT NULL, address NOT NULL );不幸的是,cust.address列包含NULL值.我想使用光标将这些行从cust插入到1cust_det.我该怎么办?
Unfortunately the cust.address column contains NULL values. I want to insert these rows from cust to 1cust_det using a cursor. What do I have to do?
推荐答案INSERT INTO cust_det SELECT cust_id, cust_name, COALESCE(address, 'UNKNOWN') FROM cust
更多推荐
使用批量插入时插入空值
发布评论