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

Mysql common operators and functions

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

Share

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

1. Common arithmetic operators

1.1 operators, functions, remarks

1.2 points for consideration

   (1) Integer (bigint) and Integer Operation (+, -,) results in bigint

   (2) floating point number and floating point number operation (/), the result of which is the product of the decimal places involved in the operation.

   (3) divided by 0 or other illegal operation results in NULL.

2. Common comparison operators

2.1BETWEEN AND

   checks whether a value is between values 1 and 2 (including values 1 and 2), SELECT 2 BETWEEN 1 AND 2 FROM DUAL

2.2COALESCE ()

   returns the first non-NULL value, SELECT COALESCE (NULL,'aa') FROM dual

2.3 =

   checks whether the values are equal.

   SELECT 1=NULL FROM DUAL

   SELECT 1 # 1 FROM DUAL

   SELECT NULL=NULL FROM dual

   SELECT (1, 2) = ('1, 2, 2) FROM dual

2.4GREATEST ()

   returns the largest parameter.

2.5IN ()

   checks whether the value is within a set of values.

2.6IS NULL

   determines whether a value is null or not.

2.7LEAST ()

   returns the minimum value.

3. Logical operator

4. Assignment operator

5. Common control flow functions

   IFNULL () returns a number or string value, depending on the context in which it is used.

6. Commonly used string functions

6.1ASCII ()

   returns the ascii value of the first character

6.2CONCAT ()

   connection string.

6.3CONCAT-WS ()

   concatenates strings with delimiters.

6.4LCASE ()

   converts uppercase letters to lowercase letters.

6.5LIKE ()

  %: zero or more characters.

   _: one character.

   returns a value containing a character.

6.6TRIM ()

   removes leading and trailing spaces.

6.7SUBSTR ()

   returns substring function

7. Mathematical function

8. Time and date function

9. Class conversion function

10. Aggregate function

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: 274

*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