Select * from VIEW_App_Report_HistoryReport 
where  DataFileTypeCode='IEAS_T_PU' and 
OrgnizationTypeCode='02' and 
history_report_id in 
(select history_report_id from app_reportbasedata where  F_year='2006' and  F_Month = '11'
 group by history_report_id,reportcode having sum(value)>0 )