Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report