oracle 的常用sql

1. merge into 

<insert id = "insertXXX" paramerType = "java.util.HashMap">

  merge into t_comm_code C

  using(select #{info} as INFO, #{TMR} as tmr from dual) T

  on (C.INFO = T.INFO and C.TMR = T.TMR)

  when matched then 

    update set C.update_date = SYSdate
  when not matched then

    insert(id, tmr)

    values(SYS_GUID(), #{tmr})

</insert>

  

2. select LISTAGG(to_char(g.config), ',') withIn group (order by g.user_id)  from tab_user g where g.user_id = '  ';

  // 将查询的数据以 “,” 拼接,返回字符串

posted @ 2022-05-16 14:36  IT6889  阅读(27)  评论(0编辑  收藏  举报