--Process Control Functions--1, Query the employee department number, and give the department nameSelectEmpno,ename,deptno, CaseDeptno when Ten Then '10 Department Door' when - Then '20 Department Door' Else '30 Department Door' End fromEMP--2, Judge salary is less than 1000, less than 4000, greater than 4000SelectEmpno,ename,sal, Case whenSal< + Then 'Big Poor' whenSal<4000 Then 'Medium Pauper' Else 'Big Boss' End fromEMP--3. Judgment is TrueSelect if(2>1,'2 large','1 large') fromDual--4. Judgment is FalseSelect if(1>2,'2 large','1 large') fromDual--5, if NULL returns 0, with coalesce ()SelectIfnull (Comm,0),COALESCE(Comm,0) fromEMP--6, if two number same return empty, if not the same return the first parameterSelect Nullif(4,8) fromDual--7. Querying the databaseSelect Database() fromDual--8. Querying the database versionSelectversion () fromDual--9. Query User nameSelect User() fromDual--10.SelectInet_aton ('127.0.0.1'), Inet_ntoa ('2130706433')--11. Password EncryptionSelectPassword'KKK')--12, MD5 encryptionSelectMD5 ('123'),Nullif(MD5 ('123'), MD5 ('123'))
MySQL Learn the third day exercise (Process Control function)