String lookup functions in orcal and SQL Server

Source: Internet
Author: User

INSTR (C1,c2[,i[,j])

function searches for a specified character in a string, returning the location of the specified character;

"description" multibyte character (kanji, full-width, etc.), calculated as 1 characters

"Parameters" C1 the string being searched for

C2 the string you want to search

I Search start position, default is 1

J-J-Occurrence position, default 1

"Return" value

Example

Select InStr (' ABCDEFGC ', ' C ', up) from dual;

Returns: 8

CHARINDEX (C1,c2[,i])

function searches for a specified character in a string, returning the location of the specified character;

"description" multibyte character (kanji, full-width, etc.), calculated as 1 characters

"Parameters" C1 the string you want to search for

C2 string to be searched

I Search start position, default is 1

return value values

Instance

Select CHARINDEX (' C ', ' ABCDEFGC ', 4)

Returns: 8

The "summary" needs to be noted that although the functions of the INSTR and CHARINDEX functions are the same, the c1,c2 means the opposite, and the INSTR function is more powerful, you can find the location of the first J occurrence.

String lookup functions in orcal and SQL Server

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.