目前我所知道的有三种方法:
1. 使用if语句
select if(age is null,18,age) from student
2. 使用函数:
2.1 isnull
SELECT isnull(age,18) from Student
2.2 coalesce
select coalesce(age,18) from student
欢迎大家补充!
目前我所知道的有三种方法:
1. 使用if语句
select if(age is null,18,age) from student
2. 使用函数:
2.1 isnull
SELECT isnull(age,18) from Student
2.2 coalesce
select coalesce(age,18) from student
欢迎大家补充!