String Functions in SQL - sql - sql tutorial - learn sql




  • SQL string functions are used primarily for string manipulation.
 string function
  • In this, we cover common string functions seen in SQL.
  • Different RDBMS may employ different string functions, and there may also be differences in the syntax for each RDBMS even when the function call is the same.
  • All such differences are explained in each section.
  • Please note that we do not list all possible SQL string functions in this tutorial.
  • Rather, the most commonly used ones are covered.
sql tutorial , pl sql tutorial , mysql tutorial , oracle tutorial , learn sql , sql server tutorial

SQL String Functions

Function Description
CAST Converts data from one data type to another.
CONVERT Converts data from one data type to another.
CONCATENATE Combines the results of several columns together.
SUBSTRING Returns a portion of a string.
INSTR Finds the starting location of a pattern in a string.
TRIM Removes specified prefix or suffix from a string. The most common pattern being removed is white space.
LENGTH Returns the length of a string.
REPLACE Updates the content of a string.
TO_DATE Converts a string to a date.
Function Description
ASCII Returns the number code that represents the specific character
CHAR Returns the character based on the number code
CHARINDEX Returns the location of a substring in a string
CONCAT Concatenates two or more strings together
Concat with + Concatenates two or more strings together
DATALENGTH Returns the length of an expression (in bytes)
LEFT Extracts a substring from a string (starting from left)
LEN Returns the length of the specified string
LOWER Converts a string to lower-case
LTRIM Removes leading spaces from a string
NCHAR Returns the Unicode character based on the number code
PATINDEX Returns the location of a pattern in a string
REPLACE Replaces a sequence of characters in a string with another set of characters
RIGHT Extracts a substring from a string (starting from right)
RTRIM Removes trailing spaces from a string
SPACE Returns a string with a specified number of spaces
STR Returns a string representation of a number
STUFF Deletes a sequence of characters from a string and then inserts another sequence of characters into the string, starting at a specified position
SUBSTRING Extracts a substring from a string
UPPER Converts a string to upper-case

This tutorial provides more the basic needs and informations on sql tutorial , pl sql tutorial , mysql tutorial , sql server , sqlcode , sql queries , sql , sql formatter , sql join , w3schools sql , oracle tutorial , mysql , pl sql , learn sql , sql tutorial for beginners , sql server tutorial , sql query tutorial , oracle sql tutorial , t sql tutorial , ms sql tutorial , database tutorial , sql tutorial point , oracle pl sql tutorial , oracle database tutorial , oracle tutorial for beginners , ms sql server tutorial , sql tutorial pdf

Related Searches to String Functions in SQL