根据业务逻辑处理空值
--516097
select * from tab_base_moneylist a where a.memo is null
--516093
select * from tab_base_moneylist a where a.pk is null
update tab_base_moneylist set memo='OrderItemMobile='||pk where memo is null;
commit;
2012-08-01
update tab_base_moneylist set memo='OrderItemMobile='||pk where memo is null and pk is not null;
commit;
select * from tab_base_moneylist a where a.pk is null and a.memo is null and a.url like '/topup/orderItemMobileAdminLoad.php?id=%'
update tab_base_moneylist set memo='OrderItemMobile!'||id where a.pk is null and a.memo is null and a.url like '/topup/orderItemMobileAdminLoad.php?id=%';
commit;
select * from tab_base_moneylist a where a.memo is null and pk is not null
select * from tab_base_moneylist a
where (a.memo,a.tradetype_id) in
(select memo,tradetype_id from tab_base_moneylist group by memo,tradetype_id having count(*) > 1)
and rowid not in (select min(rowid) from tab_base_moneylist group by memo,tradetype_id having count(*) > 1);
update tab_base_moneylist a set a.memo=a.memo||'!'||id
where (a.memo,a.tradetype_id) in
(select memo,tradetype_id from tab_base_moneylist group by memo,tradetype_id having count(*) > 1)
and rowid not in (select min(rowid) from tab_base_moneylist group by memo,tradetype_id having count(*) > 1);
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/25198367/viewspace-740473/
,如需转载,请注明出处,否则将追究法律责任。