列出EMP表的唯一部门 [英] List unique departments of the EMP table

查看:56
本文介绍了列出EMP表的唯一部门的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上deptname在emp表中不可用,这就是我使用join语句编写查询的原因是否正确.....?请重播我任何bady知道.......?



QUERY:

Actually deptname is not available in emp table, that is the resion why i'm writing query by using join statement is it correct or not.....? Please replay me any bady knows.......?

QUERY:

SELECT DISTINCT(DNAME) FROM EMP INNER JOIN DEPT ON EMP.DEPTNO=DEPT.DEPTNO;

推荐答案

此查询将为您提供包含员工的所有部门的列表。

如果这就是你需要的,那就是正确的。
This query will give you a list of all departments that have employees in them.
If this is what you need, then it is correct.


这篇关于列出EMP表的唯一部门的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆