简体   繁体   English

如何删除和替换“)”空间?

[英]How to remove and replace “)” space?

i have problem how to remove space between ")","(" and "/" in the sql. i just want to remove space NOT include the text . How to do that?. 我在SQL中如何删除“)”,“(”和“ /”之间的空格时遇到问题。我只想删除NOT include the text空格, NOT include the text怎么办?

For example:-
Sek. 175 (1) (a)/(b) atau Sek. 187B (1) (a)/(b)

AND i want the text to be like this:
Sek.175(1)(a)/(b) atau Sek.187B(1)(a)/(b)

This is my query:
SELECT distinct mhn.id_mohon,
'oleh sebab (' || ku.ruj_kanun || ')' ruj_kanun
  FROM mohon mhn, kod_urusan ku, mohon_ruj_luar mrl, pguna pg,
       kod_perintah kp
 WHERE mhn.id_mohon = :p_id_mohon
   AND mhn.kod_urusan = ku.kod(+)
   AND mhn.id_mohon = mrl.id_mohon(+)
   AND mrl.kod_perintah = kp.kod(+)
   AND mhn.dimasuk = pg.id_pguna(+)
   AND mhn.kod_urusan = 'PHKK'

Anyone know about this? 有人知道吗?

  replace(
    regexp_replace(
      regexp_replace(
        regexp_replace(
           string, 
           '\s([a-zA-Z]+($|\W))', chr(0)||'\1'
        ), 
        '((^|\W)[a-zA-Z]+)\s', '\1'||chr(0)
      ),
    '\s'),
  chr(0), ' ')

fiddle 小提琴

绝对不是最有效的,但这应该可行

REPLACE(REPLACE(column, ' ', ''), 'atau', ' atau ')
Replace(') (', ')(')

等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM