This is probably an amateur question but I'm an amateur ! ;o)
I have several tables: Account table, Officer table, Location table, Web table... The Officer table doesn't give me the number of officers per account.
I need to retrieve only the开发者_运维知识库 accounts that have more than 20 officers. Should I use the COUNT ? If so, how ?
Your help is greatly appreciated. Thanks.
Pat
Update:
select a.id, a.eff-date, l.address, l.city, c.phonenumber
from Account a 
left outer join location l on a.id = l.id
left outer join contact c on a.id = c.id
where a.id in (
    select a.id
    from Account a
    inner join Officer ao on a.id = ao.id
    group by a.id
    having count(*) > 20    
)
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论