Mysql ifnull函数 跟COALESCE 函数

我需要的是查询数据库中最后一条数据的一个值这里用id代替了,如果没有值需要返回0

SELECT COALESCE(id,count(id)) FROM user ORDER BY id DESC LIMIT 1
数据库中没有数据时返回0

SELECT COALESCE(mp.serial_number,0) FROM marketing_plan mp ORDER BY mp.marketing_plan_id DESC LIMIT 1
数据库中没有数据时返回null

为什么?用的是navicat for mysql

count 是返回条数,没记录是0调。函数计算的。
例如: select count(*) from tablename where 1=2;