I. Process functions
--Create a table to describeCREATE TABLESalary (UserIDINT, salaryDECIMAL(9,2));INSERT intoSalaryVALUES(1, +),(2, -), (3, the),(4,4000),(5, the), (1,NULL);SELECT * fromSalary
1. if (value,t,f) more than 2000 of the use of high, otherwise with low
SELECT IF (Salary> ,'high','low' from Salary
2. Ifnull (VALUE1,VALUE2) The following statement replaces the null value 0
SELECT Ifnull (Salary,0 from salary;
3.case when ... To achieve high and low pay
SELECT Case whenSalary<= - Then ' Low' whenSalary>=2001 andSalary<=4000 Then'Middle' ELSE ' High' END fromSalary
Two. Other common functions
SELECT DATABASE() as 'Database name', VERSION () as 'Database Version',USER() as 'Current user name', Inet_aton ('192.168.1.1') as 'IP bytes', Inet_ntoa (3232235777) as 'IP byte to IP'
2. PASSWORD returns the encrypted character, typically used to set the password of the system user
SELECT PASSWORD ('123456')
3. MD5 (STR) encryption for general application data
SELECT MD5 ('123456');
MySQL Development basic Series 7 process functions and other functions