SQL String Functions

SOUNDEX()

SOUNDEX converts an alphanumeric string to a four-character code that is based on how the string sounds when spoken in English. The first character of the code is the first character of character_expression, converted to upper case.   Two srings may be evaluated to see how similar they sound when spoken. — SOUNDEX() SELECT SOUNDEX(‘FLOYD’) AS

SOUNDEX() Read More »

REPLACE()

Syntax: REPLACE(string, old_string, new_string)   Replace(): Allows us to replace one word or character with another.   — The REPLACE() REPLACES one string with another SELECT REPLACE(‘Floyd’, ‘F’, ‘L’) AS REPLACED FROM DUAL;

REPLACE() Read More »

LPAD()

Purpose The LPAD function inserts padding to the left of a string. Useful for formatting the output of a query –LPAD inserts padding tot he left of a string. it takes 3 arguments, string, lenth of the string and the padding string SELECT LPAD(‘Good’, 15, ‘?’) FROM DUAL;   — RPAD inserts padding to the

LPAD() Read More »

CONCAT()

Purpose: CONCAT returns char1 concatenated with char2 The string returned is in the same character set as char1  Oracle Database returns the datatype that results in a lossless conversion. Lossless, as the name suggests, means a conversion that does not result in loss of data. if one of the arguments is a LOB, then the returned

CONCAT() Read More »

Scroll to Top