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

Number----char (to_char)

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

1mai numbermuri Muttchar (to_char)

A number is converted to a character type, and when the format is specified, the positive number will be used to store the previous'+'by one more byte.

SQL > select length (23), length (- 23) from dual

LENGTH (23) LENGTH (- 23)

--

2 3

SQL > select length (to_char (23)), length (to_char (- 23)) from dual

LENGTH (TO_CHAR (23) LENGTH (TO_CHAR (- 23))

--

2 3

SQL > select length (to_char (23 ~ (99'), length (to_char (- 23 ~ () from dual

LENGTH (TO_CHAR (23)) LENGTH (TO_CHAR (- 23))

-

3 3

Extra placeholders are supplemented with spaces

SQL > select length (to_char (23recoveryS99')), length (to_char (0pencil S99')) from dual

LENGTH (TO_CHAR (23meme STM9')) LENGTH (TO_CHAR (0pencil S99'))

-

3 3

You can display'+'by using'S'

SQL > select to_char (23penny S99'), to_char (- 23pencil S99') from dual

TO_CHAR (23penny S99') TO_CHAR (- 23penny S99')

--

SQL > select length (to_char (23recoveryTM9')), length (to_char (- 23recoveryTM9') from dual

LENGTH (TO_CHAR (23 ~ TM9')) LENGTH (TO_CHAR (- 23 ~ ())

2 3

TM minimum format output, which removes spaces and the preceding'+', just like without format parameters

SQL > select length (to_char (23recoveryTM9')), length (to_char (- 23recoveryTM9') from dual

LENGTH (TO_CHAR (23 ~ TM9')) LENGTH (TO_CHAR (- 23 ~ ())

2 3

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