MYSQL CASE THEN statement with multiple values

前端 未结 4 1044
终归单人心
终归单人心 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:38

    No. CASE statement can only return a single value, so the only way to achieve what you want is duplicate the case ...

    The database server should be optimized and perform only one time the check on the same condition ...

提交回复
热议问题