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

Introduction to formatting function of mysql

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

Share

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

In this issue, the editor will bring you an introduction to the formatting function of mysql. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

Mysql format function:

1. DATE_FORMAT (date,fmt): format the date value according to the string fmt.

2. FORMAT (xQuery y): format x as a sequence of numbers separated by commas, where y is the number of decimal places of the result.

3. INET_ATON (ip): returns a numeric representation of the IP address.

4. INET_NTOA (num): returns the IP address represented by the number.

5. TIME_FORMAT (time,fmt): format the time value according to the string fmt.

The simplest of these is the FORMAT () function, which formats large numbers into easy-to-read sequences separated by commas.

Example:

SELECT FORMAT (34234.34323432); SELECT DATE_FORMAT (NOW (),'% WMague% D% M% Y% r'); SELECT DATE_FORMAT (NOW (),'% Ymuri% mmi% d'); SELECT DATE_FORMAT (19990330); SELECT DATE_FORMAT (NOW (),'% hpurl% I% p'); SELECT INET_ATON ('10.122.89.47'); SELECT INET_NTOA (175790383) The above is the introduction of the formatting function of mysql shared by Xiaobian. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

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