0

我有问题如何在sql中删除“)”,“(”和“/”之间的空格。我只想删除空格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'

有人知道吗?

4

3 回答 3

1
  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), ' ')

小提琴

于 2013-05-22T08:42:56.987 回答
0

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

REPLACE(REPLACE(column, ' ', ''), 'atau', ' atau ')
于 2013-05-22T08:23:04.690 回答
0
Replace(') (', ')(')

等等。

于 2013-05-22T08:25:59.980 回答