SQL Nested Select statements with COUNT()
===

I'll try to describe as best I can, but it's hard for me to wrap my whole head around this problem let alone describe it....

I am trying to select multiple results in one query to display the current status of a database. I have the first column as one type of record, and the second column as a sub-category of the first column. The subcategory is then linked to more records underneath that, distinguished by status, forming several more columns.  I need to display every main-category/subcategory combination, and then the count of how many of each sub-status there are beneath that subcategory in the subsequent columns.  I've got it so that I can display the unique combinations, but I'm not sure how to nest the select statements so that I can select the count of a completely different table from the main query.  My problem lies in that to display the main category and sub category, I can pull from one table, but I need to count from a different table.  Any ideas on the matter would be greatly appreciated

Here's what I have.  The count statements wuold be replaced with the count of each status:

select
  wave_num "WAVE NUMBER"
, int_tasktype "INT / TaskType"
, count(1) TOTAL
, count(1) "LOCKED/DISABLED"
, count(1) RELEASED
, count(1) "PARTIALLY ASSEMBLED"
, count(1) ASSEMBLED
from 
  (
  select 
    distinct (t.invn_need_type || ' / ' || s.code_desc) int_tasktype
  , t.task_genrtn_ref_nbr wave_num
  from 
    sys_code s
  , task_hdr t
  where 
    t.task_genrtn_ref_nbr in 
    (
    select ship_wave_nbr 
    from ship_wave_parm 
    where trunc(create_date_time) like sysdate - 7
    )
    and s.code_type = '590' and s.rec_type = 'S' and s.code_id = t.task_type
  )
, ship_wave_parm swp  
group by wave_num, int_tasktype
order by   wave_num