1.場景一
有時查詢數量a 同時查詢過濾后的數量b
2. 代碼
SELECT count(id) as total_count, count( IF ( date(order_time) = DATE(now()), 1, NULL ) ) as today_count FROM passenger_activity_record where a = #{a,jdbcType=INTEGER} and b_id= #{bId,jdbcType=INTEGER}
3. 說明
3.1 可以嵌套
3.2 ifnull(condition, expr1)功能類似 當condition為null 則返回expr1 ,否則返回 condition
