Select查询我有一个输入的数据, 有两个表SQL:没有嵌套查询
create table Courses(
id number(19) not null,
name varchar(100),
);
create table Students (
id number (19) not null,
name varchar(100),
course_id number (19) not null,
);
我需要编写查询得到所有cources与学生例如数超过10 所以,我受够了嵌套查询写入变种这样
select distinct courses.name from student, courses where courses.id=student.courses_id and (select count(Students.id) from Students where student.course_id = course.id) > 10
!没有测试,只是写这篇文章,它是例子! 所以,我的问题是如何编写相同的查询没有嵌套查询?
谢谢你,我没有想过group by和having ...我...失败谢谢 –