Serial number |
function function |
SQL Server usage |
Oracle usage |
1 |
To find a character ordinal |
Select ASCII (' a ') |
Select ASCII (' a ') value from dual |
2 |
To find a character from an ordinal |
Select char (value) |
Select CHR value from dual |
3 |
Connection |
Select ' One ' + ' + ' + ' value ' |
Select CONCAT (' 11 ', ' 22 ') | | Value from dual |
4 |
Sub-string position |
Select CHARINDEX (' s ', ' SDSQ ', 2) value |
Select InStr (' SDSQ ', ' s ', 2) value from dual |
5 |
Bits of the fuzzy substring (return 2, parameter minus middle% is returned 7) |
Select Patindex ('%d%q% ', ' sdsfasdqe ') value |
Select INSTR (' sdsfasdqe ', ' SD ', $) value from dual returns 6 |
6 |
To find a child string |
Select substring (' ABCD ', 2,2) value |
Select substr (' ABCD ', 2,2) value from dual |
7 |
Substring substitution (return AIJKLMNEF) |
SELECT STUFF (' abcdef ', 2, 3, ' IJKLMN ') value |
SELECT Replace (' abcdef ', ' BCD ', ' ijklmn ') value from dual |
8 |
Sub-string Replace all |
Didn't find |
Select Translate (' Fasdbfasegas ', ' fa ', ' I ') value from dual |
9 |
Length |
Len or Datalength |
Length |
10 |
Uppercase and lowercase conversions |
Lower,upper |
Lower,upper |
11 |
Capitalize the first letter of the word |
Didn't find |
Select Initcap (' ABCD Dsaf df ') value from dual |
12 |
Left Fill space |
Select Space + ' ABCD ' value |
Select Lpad (' ABCD ', +) value from dual |
13 |
Right fill space |
Select ' ABCD ' +space (Ten) value |
Select Rpad (' ABCD ', +) value from dual |
14 |
Remove spaces |
Ltrim,rtrim |
Ltrim,rtrim,trim |
15 |
Repeating string |
Select REPLICATE (' ABCD ', 2) value |
Lpad (' d ', 6, ' 0 '), Rpad (' d ', 6, ' 0 ') |
16 |
Comparison of pronunciation similarities (the two words return the same value, pronounced the same) |
SELECT SOUNDEX (' Smith '), SOUNDEX (' Smythe ') |
SELECT SOUNDEX (' Smith '), SOUNDEX (' Smythe ') from dual |