Here is the SQL: explanation of what I am trying to do follows the SQL:
select a.warehouse,
count(1) NUM_LINES, (select count(1) as zero_bal
FROM inventory b where b.warehouse='ACE' and
b.Q_RO > 0 and b.q_oh=0)
FROM inventory a WHERE a.warehouse='ACE'
and a.q_RO > 0 GROUP BY a.warehouse;
What I am trying (very uncessfully) is to get counts from a single table where
different conditions are met. In this eaample, I need to get acount of lines
in warehouse ACE where (Q_RO > 0) and a count of all the zero balance or Quanity on hand = 0. (Q_OH=0)
Bookmarks