MYSQL CASE THEN statement with multiple values

前端 未结 4 969
终归单人心
终归单人心 2021-02-07 08:00

I am trying go select multiple values with CASE statement. I noticed we cannot do

CASE 
    WHEN wall.type=\"bk\" 
    THEN books.id1,books.id2, //         


        
4条回答
  •  我在风中等你
    2021-02-07 08:48

    According to documentation mysql_doc; you can use you can use the other syntax of case for what you wanted.

    case
     WHEN FIND_IN_SET(edu, "1,1st,2,2nd,3,3rd,4,4th,5,5th,pri,primary,primery") THEN
      SET memEdu = "Primary";
     WHEN FIND_IN_SET(edu, "intermediate,inter,f.a,fa,fac,f.a.c,f.sc,fsc,1rd year,2rd year,3rd year") THEN
      SET memEdu = "Intermediate";
    End case;
    

提交回复
热议问题