MySQL Forums
Forum List  »  SQLite

Subqueries
Posted by: shan hyland
Date: July 21, 2009 07:30AM

Hi,

I am doing an assignment using SQLite and was wondering if someone could tell me why this doesn't work and maybe offer some help please?

select *, count(distinct au.acNum) as auNum, count(int.acNum) as intNum
from academic ac
LEFT OUTER JOIN author au on ac.AcNum = au.AcNum
LEFT OUTER JOIN interest int on int.AcNum = ac.AcNum
group by ac.AcNum
having count(distinct au.acNum) =

(select Max(int.acNumCount)
from (select count(int.acNum) as int.AcNumCount
from academic ac
LEFT OUTER JOIN author au on ac.AcNum = au.AcNum
LEFT OUTER JOIN interest int on int.AcNum = ac.AcNum
group by ac.AcNum
having auNum = 0))

Options: ReplyQuote


Subject
Views
Written By
Posted
Subqueries
9167
July 21, 2009 07:30AM
5609
July 22, 2009 02:53AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.