I wrote this little query to show me how many unique instances of BREAK I have per ITEM. Output looks good. I want to add 'WHERE NUM > 1, to show only where there is more than 1 instance. It's not liking my syntax when I attempt to add this.
count(BREAK)OVER(PARTITION BY ITEM) NUM
Select INVT_LEV1 ITEM, INVT_QTY_BKD_FACT BREAK
where Cust_Code = 'GMAFH'
and COMP_CODE = 'W1'
and ON_HAND_QTY > 0
GROUP BY INVT_LEV1, INVT_QTY_BKD_FACT
order by INVT_LEV1)
where NUM > 1 <----------------- this line is giving error when present !!!!
group by ITEM, BREAK