MySQL Learn the third day exercise (Process Control function)

Source: Internet
Author: User

--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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.