ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 根据业务逻辑处理空值或重复值

根据业务逻辑处理空值或重复值

原创 Linux操作系统 作者:golden_zhou 时间:2012-08-09 10:39:25 0 删除 编辑
根据业务逻辑处理空值
 --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/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-03-09

  • 博文量
    238
  • 访问量
    344450