mysql 学习记录

mysql 学习记录

2022年1月20日回顾

union 和 union all 区别, union是会过滤和重新排序的,union all 能够合并但不去重

exists 和 not exists 表示 存在或者不存在,适用于替代 in

select * from table t1 where exists (select * table t2 where t1.id=t2.id )

nvl(a,b) a为null,则取b,否则取a

cast 类型转换

case when 条件选择
posted @ 2022-01-20 17:07  Johnsonbug  阅读(20)  评论(0编辑  收藏  举报