`
jianghs
  • 浏览: 22113 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

把子记录的开始日期设置为父记录的结束日期

 
阅读更多

 

create table temptbl as select a.id,
       b.endtime as starttime,
       a.endtime,
       a.parentid,
       a.initstateid,
       a.ispass,
       a.suggest,
       a.auditoperid
  from hisrecord_13 a
  left join hisrecord_13 b on a.parentid = b.id
 where a.parentid <> 0

union
select *
  from hisrecord_13 vv
 where vv.parentid = 0

 order by id

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics