Criteria for judging in MySQL

Source: Internet
Author: User

    • If/case when to judge
Select Case 1 if 1 then "one" while 2 then "one" and "more" END; "One" Select Case when    1>0 and "true" ELSE "false" END; "true" Select Case    BINARY "B" when "a" N 1 when the "B" then 2 END; and NULL    (1) Case VALUE when [compare-value] then result [when [compare-value] then result ...] [ELSE result] END//This I have not thought of how to use, know can message exchange,    (2) case when [CONDITION] then result [when [CONDITION] then result ...] [ELSE result] END//This interview was asked by people, can be used as a condition to judge
    • ISNULL judgment
Usage of ISNULL (expr):    If expr is null, then the return value of ISNULL () is 1, otherwise the return value is 0.    ifnull (EXPR1,EXPR2) Usage:    If EXPR1 is   not   NULL, the   return value of Ifnull ()   is   expr1;    Otherwise its return value is   expr2. The return value of Ifnull () is either a number or a string, depending on the context in which it is used.

Criteria for judging in MySQL

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.