Hubboo <[email protected]> wrote:
> Q. Among the academics who have no papers, who has the greatest
> number of interests..
>
> Database looks like
>
> Department(DeptNum, Descrip, Instname, DeptName, State, Postcode)
> Academic(AcNum, DeptNum, FamName, GiveName, Initials, Title)
> Paper(PaNum, Title)
> Author(PaNum, AcNum)
> Field(FieldNum, ID, Title)
> Interest(FieldNum, AcNum, Descrip)
Try this:
select * from Academic
where AcNum = (
select AcNum from Interest
where AcNum not in (select AcNum from Author)
group by AcNum
order by count(*) desc limit 1
);
Igor Tandetnik
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users