Mysql> SELECT IF (STRCMP (' str ', ' str1 '), ' yes ', ' no '); +----------------------------------------+ | IF (STRCMP (' str ', ' str1 '), ' yes ', ' no ') | +----------------------------------------+ | Yes | +----------------------------------------+ mysql> SELECT IF (0, ' yes ', ' www.111cn.net '); +--------------------+ | IF (0, ' yes ', ' no ') | +--------------------+ | No | +--------------------+ mysql> SELECT IF (null, ' yes ', ' no '); +-----------------------+ | IF (null, ' yes ', ' no ') | +-----------------------+ | No | +-----------------------+ mysql> SELECT IF (' null ', ' yes ', ' no '); +-------------------------+ | IF (' null ', ' yes ', ' no ') | +-------------------------+ | No | +-------------------------+ Mysql> SELECT IF (false, ' yes ', ' no '); +------------------------+ | IF (False, ' yes ', ' no ') | +------------------------+ | No | +------------------------+ Mysql> SELECT IF ( -10, ' yes ', ' no '); +----------------------+ | IF ( -10, ' yes ', ' no ') | +----------------------+ | Yes | +----------------------+ Mysql> SELECT IF (Ten, ' Yes ', ' no '); +---------------------+ | IF (+, ' yes ', ' no ') | +---------------------+ | Yes | +---------------------+ mysql> SELECT IF (' 0 ', ' yes ', ' no '); +----------------------+ | IF (' 0 ', ' yes ', ' no ') | +----------------------+ | No | +----------------------+ |