In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The following to understand the main commonly used functions and functions of MySQL, I believe you will benefit a lot after reading, the text in the essence is not much, hope that the main common functions and functions of MySQL this short content is what you want.
String function
Function function CONCAT (s _ 1 ~ S _ 2 ~....) String concatenation INSERT (str,x,y,instr) replaces the specified string from start to end with the specified string LOWER (str) converts all characters to lowercase UPPER (str) converts all strings to uppercase LEFT (str,x) returns the string str leftmost x characters RIGHT (str,x) returns the string str rightmost x characters LPAD (str,n,pad) fills n padRPAD (str) on the far left side of str N padLTRIM (str) fill in n padLTRIM (str) on the rightmost side of str remove the space on the left side of the string str (str) remove the space on the right side of the string str REPEAT (str,x) return the result of str repeat x times STRCMP (S1 Personality S2) compare the string S1 and s2REPLACE (str,a,b) replace all the strings aTRIM (str) that appear in the string str with the string b remove the spaces at the end and header of the string SUBSTRING (str,x) Y) returns a string of y characters from the position of the string str x
Mathematical function
The function function ABS (x) returns the absolute value of x CEIL (x) returns the minimum integer value FLOOR (x) that is greater than x, returns the maximum integer value MOD (x) that is less than x, returns the random value of ROUND (x) in 0 prime 1, returns the value TRUNCATE (x) of the rounded y decimal place of parameter x, returns the result of the number x truncated y place decimal place.
Date and time function
The function CURDATE () returns the current date CURTIME () returns the current date and time NOW () returns the current date and time UNIX_TIMESTAMP (date) returns the UNIX timestamp of the date date FROM_UNIXTIME returns the date value of the UNIX timestamp WEEK (date) returns the date date the week of the year YEAR (date) returns the year of the date date HOUR (time) returns the hour value of time MINUTE (time) returns the minute value of time MONTHNAME (date) returns the month name DATE_FORMAT (date) of date Fmt) returns a date value in string fmt format date _ ADD (date,interval expr type) returns a date or time value plus a time interval value DATEDIFF (expr,expr2) returns the number of days between the start time expr and the end time expr2
Flow function
Function IF (value,t f) returns t if value is true, otherwise returns fIFNULL (value1,value2) if value1 is not empty, returns value1, otherwise returns value2CASE WHEN [value1] then [result 1]... ELSE [default] END returns result1 if value1 is true, otherwise returns result1 [value1] WHEN [result 1]... ELSEdefault] END returns result1 if expr equals value1, otherwise returns ELSE
Other common functions
Function DATEBASE () returns the current database name VERSION () returns the current database version USER () returns the current login user name INET_ATON (ip) returns the number of the ip address INET_NTOA (num) returns the ip address represented by the number PASSWORD (str) returns the encrypted version of the string str MD5 () returns the MD5 value of the string str
After reading this article on the main common functions and functions of MySQL, many readers will want to know more about it. If you need more industry information, you can follow our industry information section.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
[oracle@king01 ~] $sqlplus / as sysdbaSQL > @ user_sessions_all.sql+--
© 2024 shulou.com SLNews company. All rights reserved.