SELECT DEPARTMENT.D#,DEPARTMENT.DNAME,DEPARTMENT.MANAGER#
FROM DEPARTMENT,PROJECT
WHERE DEPARTMENT.D# <> PROJECT.D#;

当此代码在SQL plus中运行时,出现了很多重复的输出,我的输出应该只有一次。

===============>>#1 票数:0

不知道这是否是您想要的东西,但是如果您只希望那些没有任何项目的部门使用

SELECT DEPARTMENT.D#,DEPARTMENT.DNAME,DEPARTMENT.MANAGER#
   FROM DEPARTMENT
      WHERE DEPARTMENT.D# not in (select PROJECT.D# from project);

希望能帮助到你

维沙德

===============>>#2 票数:0

用于

SELECT DEPARTMENT.D#,DEPARTMENT.DNAME,DEPARTMENT.MANAGER#
  FROM DEPARTMENT,PROJECT
  WHERE DEPARTMENT.D# != PROJECT.D#;

  ask by user3553846 translate from so

未解决问题?本站智能推荐: