ITPub博客

首页 > Linux操作系统 > Linux操作系统 > sql_update_以学段为单位只更新每个学科第一条记录的for_stage为y

sql_update_以学段为单位只更新每个学科第一条记录的for_stage为y

原创 Linux操作系统 作者:wisdomone1 时间:2010-07-16 16:24:36 0 删除 编辑
##以学段为单位只更新每个学科第一条记录的for_stage为y
update e_subjectinfo set for_stage=null;
 

update e_subjectinfo a set a.for_stage='Y'
where a.rowid=(select min(b.rowid) from e_subjectinfo b where  a.subjectname=b.subjectname and a.teachstage=b.teachstage)

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9240380/viewspace-668201/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
提供针对oracle初学者及进阶的数据库培训,欢迎大家咨询: 微信: wisdomone 微信公众号: lovedb 工作经历: 中国普天 北京科蓝 北京云和恩墨 北京神州新桥

注册时间:2008-04-04

  • 博文量
    2189
  • 访问量
    12690554