In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to use the built-in functions in MySQL and PHP. The introduction in this article is very detailed and has a certain reference value. Interested friends must read it!
MySQL built-in function
MySQL built-in functions can help us to deal with the data in the table more easily and simplify the operation.
Mathematical function:
Function description ABS () take absolute value SQRT () take root sign MOD () take module FLOOR () return not greater than the maximum integer value CELLING () return not less than the minimum integer value ROUND () round off SIN () take sine COS () take cosine
String function:
Function description LENGTH () takes string length LOWER () converts all strings to lowercase UPPER () converts strings to uppercase TRIM () removes both ends, prefix or suffix REPLACE () replaces strings
Date-time function:
Function description NOW () get current time date CURDATE () get current date CURTIME () get current time YEAR () get year MONTH () get month DAY () get day date_format () conversion time format
Aggregate function:
Function description COUNT () the number of statistical rows MAX () gets the maximum value MIN () gets the minimum value SUM () gets the cumulative value
Conditional judgment function:
Function description IF if IFNULL if empty CASE WHEN condition judgment example 1
See how many pieces of data exist in the table:
Output result:
Server connected successfully!
The SQL statement was executed successfully!
Array
(
[count (*)] = > 5
)
Example 2
Get the maximum wage:
Output result:
Server connected successfully!
The SQL statement was executed successfully!
Array
(
[max (salary)] = > 30000.00
)
These are all the contents of the article "how to use built-in functions in MySQL and PHP". Thank you for reading! Hope to share the content to help you, more related knowledge, 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.
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
© 2024 shulou.com SLNews company. All rights reserved.