Functions are not as portable as However, the portability of functions is not strong. Almost every major DBMS implementation supports functions that other implementations do not, and the differences are sometimes significant. For the sake of code portability, many SQL programmers do not favor the use of special implementation features. Although this is beneficial, But it is not always good for application performance. Without using these functions, writing some application code would be difficult. Other methods must be utilized to accomplish the work that the DBMS does very efficiently. If you decide to use functions, you should make sure to comment your code so that later on you (or others) know exactly what the SQL you wrote means. 2. Field concatenationSELECT CONCAT(vend_name,'(',vend_country,')') as info from vendors ORDER BY vend_name MySQL also supports the following operators: 2. Give some examples of mysql functions2.1 Symbol ProcessingLeft() Returns the characters on the left side of a string Length() Returns the length of a string Locate() Finds a substring of a string Lower() Converts a string to lowercase LTrim() Removes spaces on the left side of a string Right() Returns the characters on the right side of a string RTrim() Removes spaces on the right side of a string Soundex() Returns the SOUNDEX value of a string SubString() Returns the characters of a substring Upper() Converts a string to uppercase 2.2 Phase TreatmentAddDate() adds a date (day, week, etc.) AddTime() adds a time (hour, minute, etc.) CurDate() Returns the current dateCurTime() Returns the current timeDate() Returns the date portion of a date and timeDateDiff() Calculates the difference between two datesDate_Add() Highly flexible date operation functionDate_Format() Returns a formatted date or time stringDay() Returns the day portion of a dateDayOfWeek() Returns the corresponding day of the week for a dateHour() Returns the hour portion of a timeMinute() Returns the minute portion of a timeMonth() Returns the month portion of a dateNow() Returns the current date and timeSecond() Returns the seconds portion of a timeTime() Returns the hour portion of a date and timeYear() Returns the year portion of a date 2.3 Value ProcessingAbs() Returns the absolute value of a numberCos() Returns the cosine of an angleExp() Returns the exponential value of a numberMod() Returns the remainder of a division operationPi() Returns the ratio of piRand() Returns a random numberSin() Returns the sine of an angleSqrt() Returns the square root of a numberTan() Returns the tangent of an angle This is the end of this article about the details of You may also be interested in:
|
>>: Negative margin function introduction and usage summary
For evenly distributed layouts, we generally use ...
Possible solutions 1. Math.random generates rando...
1. Overall steps At the beginning, we introduced ...
When troubleshooting system problems, application...
Table of contents How to display SQL log? ? Descr...
The image can be easily pushed directly to the Do...
Platform deployment 1. Install JDK step1. Downloa...
When using the MySQL database, if you have not lo...
1. Prerequisites We use the require.context metho...
A composite index (also called a joint index) is ...
From the tomcat configuration file, we can see th...
Table of contents 1. Background 2. Slow query cau...
1. Purchase a server In the example, the server p...
Preface As we all know, the browser's homolog...