热线电话:13121318867

登录
2023-08-11 阅读量: 1953
CDA数据分析一级教材SQL语句06

4.DQL

4.1单表查询


-- 单独使用 select

select 1;


-- 在表中使用 select

select 1 from emp;


-- 单独使用 select

select 1+1


-- 在表中使用 select

select 1+1 from emp;


-- 单独使用 select,表达式 1+1=3 不成立,返回0

select 1+1=3


-- 表达式 1+1=2 成立,返回 (真值 )1

select 1+1=2 from emp;


-- 查询 emp 表中员工及其工资

select empno,ename,sal from emp;


-- 查询 emp 表的所有字段

select * from emp;


-- 查询 emp 表中的部门

select distinct deptno from emp;


-- 查询 emp 表中不同的部门有哪些职位

select distinct deptno,job from emp;


0.0000
0
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子