Get the App
SLTechnology News&Howtos  ›  Database  › 

Summary of functions that can be used by mysql query statements

Shulou Source: shulou.com Published: 2022-06-01 05:51:54 10月26日 Update

Mysql query statements sometimes need to use functions, but functions are more efficient than subqueries, and sometimes functions are very convenient. Here is a brief summary of the specific usage of sql functions.

1, for the digital processing function

Avg ()

Count ()

Max ()

Min ()

Sum ()

2, handling of strings

Merge string function: concat (str1,str2,str3...)

Compare string size function: strcmp (str1,str2)

Get string byte function: length (str)

Function to get the number of characters in a string: char_length (str)

Letter case conversion function: uppercase: upper (x), ucase (x); lowercase lower (x), lcase (x)

String lookup function

Gets the substring of the specified location

String emptying function

String substitution function

The above is the most common, it is best to use fewer functions in the query statement, the efficiency will be low, when dealing with a large amount of data, you can test the article from http://www.dc3688.com.

Tags: Functions characters strings queries processing statements size efficiency sometimes position uppercase letters bytes lowercase common numbers numeric processing data articles time Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Microsoft Huawei vpn MySQL