When mysql query result is null or empty string, returns the specified string

Directly on the code, pro-test available;

The SELECT  the IF (IFNULL (field, ' ) =  ' ' , ' returns the string ' fields) the AS aliases (or may not) the FROM  Table

 

Guess you like

Origin www.cnblogs.com/pyspang/p/12039755.html