Case statement in MySQL

前端 未结 6 1100
旧时难觅i
旧时难觅i 2020-11-29 00:54

I have a database table called \'tbl_transaction\' with the following definition:

id INT(11) Primary Key
action_type ENUM(\'Expense\', \'Inc         


        
6条回答
  •  孤街浪徒
    2020-11-29 01:01

    Another thing to keep in mind is there are two different CASEs with MySQL: one like what @cdhowie and others describe here (and documented here: http://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html#operator_case) and something which is called a CASE, but has completely different syntax and completely different function, documented here: https://dev.mysql.com/doc/refman/5.0/en/case.html

    Invariably, I first use one when I want the other.

提交回复
热议问题