Get the App
SLTechnology News&Howtos  ›  Database  › 

How to find out whether a string function exists in oracle database

Shulou Source: shulou.com Published: 2022-05-31 18:02:10 09月20日 Update

This article mainly introduces "how to find string function in oracle database". In daily operation, I believe that many people have doubts about how to find string function in oracle database. Xiaobian consulted all kinds of information and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubt that "how to find string function in oracle database exists". Next, please follow the editor to study!

INSTR ()

Format 1: instr (string1, string2)

Format 2: instr (string1, string2 [, start_position [, nth_appearance]])

Parsing: the value of string2 is to be found in string1, which is retrieved in string1 from the value given by start_position (that is, location), and the nth _ appearance (several times) string2 appears.

Example:

1 select instr ('helloworld','l') from dual;-return result: 3 default location of "l" for the first time

2 select instr ('helloworld','lo') from dual;-returns the result: 4 that is, in "lo", where the "l" begins to appear

3 select instr ('helloworld','wo') from dual;-returns the result: 6, that is, where "w" begins to appear

4 select instr ('helloworld','l',2,2) from dual;-returns the result: 4 that is, start at position 2 (e) of "helloworld" and find the location of the second occurrence of "l".

Query whether the string exists:

MySQL: select from tableName where name like'% helloworld%'

Oracle:select from tableName where instr (name,'helloworld') > 0;-- the effect of these two statements is the same

Select instr ("helloworld", "l") from dual

The result is: 3 #, that is, the position sequence number of "l" for the first time is 3.

Select instr ("helloworld", "lo") from dual

The result is: 4 #, that is, the position where "lo" appears for the first time is 4

At this point, the study of "how to find the string function in oracle database" is over. I hope to be able to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Position result function character string data database learning that is for the first time more format help retrieval utility and then that is to say serial number effect numerical value Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple MySQL OPPO Reno Shulou Tech Info macOS