![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
mysql
RedSiren
这个作者很懒,什么都没留下…
展开
-
mysql 值为空,就返回0
oracle中:select nvl(字段名,0) from 表名; sqlserver中:select isnull(字段名,0) from 表名; mysql中:select ifnull(字段名,0) from 表名; mysql举例: select a.stu_id,a.course_id,(IFNULL(a.score,0)+IFNULL(b.score,0)) score f...原创 2018-08-07 15:30:35 · 26919 阅读 · 0 评论 -
mysql case when 用法举例
举例: select customer_id,user_id, case when count(1) >=50 then 50 when count(1) >=40 then 40 when count(1) >=30 then 30 when count(1) >=20 then 20 when count(1) >...原创 2018-08-07 15:34:30 · 187 阅读 · 0 评论 -
mysql 定时任务
需要写一个定时任务,首先创建存储过程,然后定时执行存储过程。 创建存储过程update_maturity delimiter $$ drop PROCEDURE if EXISTS update_maturity; create PROCEDURE update_maturity() begin ... end $$ 创建定时执行事件 delimiter $$ dro...原创 2018-08-07 16:04:37 · 187 阅读 · 0 评论