Oracle stitching and replace single quotes

1.oracle splicing a single quote:

Normal writing: '' '' ||   

Because of escaped single quotes, the first and the last one is to specify the characters you want to use, and the second 'is a single quote escape character, so you need a third' is the real you that to be spliced.

It can also be used chr (39) as a mosaic character, so that it may be more intuitive.

2.oracle replace single quotes

REPLACE('a,b',',',chr(39) || ',' || chr(39)) 

Here will be replaced with ','

For example: the need for a, b replaced by 'a', 'b' can write:

    select  chr(39) || REPLACE('a,b',',',chr(39) || ',' || chr(39)) || chr(39) from dual

The results above.

Guess you like

Origin www.cnblogs.com/healer007/p/11597992.html