标签:mys condition sse color rom mysql passenger type from
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
标签:mys condition sse color rom mysql passenger type from
原文地址:http://www.cnblogs.com/rocky-fang/p/7851786.html