当前位置:网站首页>Mysql database - single table query (II)

Mysql database - single table query (II)

2022-04-23 19:42:00 X heart

The first 1 Turn off : belt LIKE Character matching query for

USE Company;

######### Begin #########
select Name ,Salary
from tb_emp
where Name like 'C%';

######### End #########

The first 2 Turn off : Querying null values and removing duplicate results

USE Company;

######### Begin #########

select *
from tb_emp
where DeptId IS NULL;
######### End #########

######### Begin #########
select distinct Name
from tb_emp;

######### End #########

The first 3 Turn off : belt AND And OR Multi criteria query of  

USE Company;

######### Begin #########
select *
from tb_emp
where DeptId='301' and Salary>3000;

######### End #########

######### Begin #########
select *
from tb_emp
where DeptId='301' OR DeptId='303';

######### End #########

版权声明
本文为[X heart]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231927030885.html