select coalesce(title,'liu') from a;
mysql中可以用 help coalesce
http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html#function_coalesce
性能測試 兩萬以內(一萬爲空,一萬不爲空)的數據和取出值再判斷是否爲null給默認值稍高,而且寫法方便
select coalesce(title,'liu') from a;
mysql中可以用 help coalesce
http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html#function_coalesce
性能測試 兩萬以內(一萬爲空,一萬不爲空)的數據和取出值再判斷是否爲null給默認值稍高,而且寫法方便