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

An introduction to Oracle Database-- one-line function

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1, one-line function

SQL >-- character function

SQL > select lower ('Hello World') turns to lowercase, upper (' Hello World') turns to uppercase, initcap ('hello world') initials uppercase

2 from dual

Turn lowercase to uppercase

Hello world HELLO WORLD Hello World

SQL >-- substr (aforme b) start with bit b in a

SQL > select substr ('Hello World',4) substring from dual

Substring

Lo World

SQL >-- substr (aheline bjorc) start with bit b in an and take bit c

SQL > select substr ('Hello World',4,3) substring from dual

Son

Lo

SQL >-- number of length characters and lengthb bytes

SQL > select length ('Hello World') character, lengthb (' Hello World') byte from dual

Character byte 11 11

SQL > ed

Written to file afiedt.buf

1 * select length ('Beijing') character, lengthb ('Beijing') byte from dual

SQL > /

Character byte 2 4

SQL >-- instr (aforme b)

SQL >-- in a, look for b

SQL > select instr ('Hello World','ll') location from dual

Location 3

SQL >-- lpad left fill rpad right fill

SQL >-- abcd-> 10 bits

SQL > select lpad ('abcd',10,'') left, rpad (' abcd',10,'') right from dual

Left and right

* * abcd abcd**

SQL >-- trim removes the specified characters before and after

SQL > select trim ('H' from 'Hello WorldH') from dual

TRIM ('H'FR

Ello World

SQL >-- replace

SQL > select replace ('Hello World','l','*') from dual

REPLACE ('HE

He*o Word

SQL > host cls

SQL >-- rounding

SQL > select round (45.926) one, round (45.926) two, round (45.926) three, round (45.926)) four, round (45.926)

2 from dual

One, two, three, four, five, 45.93, 45.9, 46, 500.

SQL >-truncation

SQL > ed

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

Servers

Wechat

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

12
Report