• oracle 一些简单操作


    merge into regist_person rp
    using dual
    on (rp.person_card = '10258968845')
    when matched then
      update
         set corp_id        = '2FC3BC773FE941CBAB8CEA31CC678595',
             GROUP_ID       = 'B51826A5B2494DD3BD3E5DBD4A089977',
             PERSON_NAME    = '李萍',
             NAME_PYJM      = 'LP',
             PERSON_SEX     = '女',
             PERSON_AGE     = '23',
             PERSON_ADDRESS = '北京市总部基地',
             PERSON_COUNTRY = '中国',
             PERSON_NATION  = '中国',
             PERSON_PHNO    = '12584785696',
             PERSON_TEL     = '10258968845',
             PERSON_EMAIL   = '39865858@qq.com',
             BIRTHDAY       = to_date('1984-7-27', 'yyyy-mm-dd HH24:mi:ss'),
             PERSON_POST    = '',
             PERSON_DEPT    = '',
             IS_MARRIAGE    = '否'
    when not matched then
      insert
        (PERSON_ID,
         CORP_ID,
         GROUP_ID,
         PERSON_NO,
         PERSON_NAME,
         NAME_PYJM,
         PERSON_SEX,
         PERSON_AGE,
         PERSON_CARD,
         PERSON_ADDRESS,
         PERSON_COUNTRY,
         PERSON_NATION,
         PERSON_PHNO,
         PERSON_TEL,
         PERSON_EMAIL,
         BIRTHDAY,
         PERSON_POST,
         PERSON_DEPT,
         IS_MARRIAGE)
      values
        ('84f26837-46e9-4cd0-bc7d-3631c5f748cc',
         '2FC3BC773FE941CBAB8CEA31CC678595',
         'B51826A5B2494DD3BD3E5DBD4A089977',
         '',
         '李萍',
         'LP',
         '女',
         '23',
         '411223197503453000',
         '北京市总部基地',
         '中国',
         '中国',
         '12584785696',
         '10258968845',
         '39865858@qq.com',
         to_date('1984-7-27', 'yyyy-mm-dd HH24:mi:ss'),
         '',
         '',
         '否')
    根据身份证判断是否存在此人,存在则修改,不存在则添加

    string sql = @"  select kindname,emr_icd10kind.id,(sum(bb)+sum(cc)+sum(dd)+sum(ee)) as  total, sum(aa) as zhiyu,sum(bb) as haozhuan,
                sum(cc) as weiyu,sum(dd) as siwang,
      sum(ee) as qita from emr_icd10kind
       left join
    (select icd10, decode(pa_leavehospital_nurcs,'治愈',count(pa_leavehospital_nurcs))aa,
    decode(pa_leavehospital_nurcs,'好转',count(pa_leavehospital_nurcs)) bb,
    decode(pa_leavehospital_nurcs,'未愈',count(pa_leavehospital_nurcs)) cc,
    decode(pa_leavehospital_nurcs,'死亡',count(pa_leavehospital_nurcs)) dd,
    decode(pa_leavehospital_nurcs,'其他',count(pa_leavehospital_nurcs)) ee
    from PATIENTS_Statistics where  Date_end >=to_date('" + dateBegin.ToString() + @"','yyyy-mm-dd hh24:mi:ss')
    and  Date_end <= to_date('" + dateEnd.ToString() + @"','yyyy-mm-dd hh24:mi:ss')
    group by icd10,pa_leavehospital_nurcs) nn
    on nn.icd10=emr_icd10kind.icdrange where emr_icd10kind.bigkindcode='D'
    group by emr_icd10kind.id,kindname order by emr_icd10kind.id";

    进行统计的一个示例

    select *  from(select rownum as rn,t.* from table t where rownum >0) where rn between 10 and 20

    oracle 取10-20条记录
  • 相关阅读:
    劝退人的不是算法本身,而是你以为是对的,但逻辑是对的,却报错
    小程序毕设开发笔记功能模块开发
    Python函数式编程
    Flask和Django的网络请求比较
    Flask与Django的表单类(待续)
    绍兴文理学院元培学院第十五届大学生程序设计竞赛题解
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'password('123')' at line 1
    vim保存修改的只读文件
    树莓派连接显示屏后显示有黒边解决方法
    MySQL Error: : 'Access denied for user 'root'@'localhost'
  • 原文地址:https://www.cnblogs.com/fish124423/p/2010220.html
Copyright © 2020-2023  润新知