Contents Index CHAR function [String] CHAR_LENGTH function [String]

ASA SQL Reference
  SQL Functions
    Alphabetical list of functions

CHARINDEX function [String]


Function 

Returns the position of one string in another.

Syntax 

CHARINDEX ( string-expression1string-expression2 )

Parameters 

string expression1    The string you are searching for.

string expression2    The string to be searched.

Usage 

The position of the first character in the string being searched is 1.

If the string being searched contains more than one instance of the other string, then CHARINDEX returns the position of the first instance.

If the string being searched does not contain the other string, then CHARINDEX returns 0.

Standards and compatibility 
See also 

SUBSTRING function [String]

Example 

The statement

SELECT emp_lname, emp_fname
FROM employee
WHERE CHARINDEX('K', emp_lname ) = 1

returns the following values:

emp_lname emp_fname
Klobucher James
Kuo Felicia
Kelly Moira

Contents Index CHAR function [String] CHAR_LENGTH function [String]