
		SELECT DISTINCT newbom.PROD_ID,  newbom.PKG_VERSION, newbom.PKG_ID,
			   			newbom.PKG_NAME 
		  FROM (
		  		SELECT osc.PROD_ID,
					   nn.NODE_NAME ||'_'|| os.OS_NAME AS PK,
					   pv.PKG_VERSION,
					   pv.PKG_ID,
					   pkg.PKG_NAME
				  FROM OS_CONTENTS osc,
				  	   OPERATING_SYSTEMS os,
					   NETWORK_NODES nn,
					   BOM_CONTENTS bc,
					   PACKAGE_VERSIONS pv,
					   PACKAGES pkg
				 WHERE osc.OS_ID = os.OS_ID
				   AND os.NODE_ID = nn.NODE_ID
				   AND bc.NODE_ID = nn.NODE_ID
				   AND osc.PROD_ID = pv.PV_ID
				
				   AND bc.BOM_ID = :COMPARE_BOM_ID
				   AND pkg.PKG_ID = PV.PKG_ID	
		  	   ) newbom,
			   (
			   	SELECT osc.PROD_ID,
					   nn.NODE_NAME ||'_'|| os.OS_NAME AS PK,
					   pv.PKG_VERSION,
					   pv.PKG_ID
				  FROM OS_CONTENTS osc,
				  	   OPERATING_SYSTEMS os,
					   NETWORK_NODES nn,
					   BOM_CONTENTS bc,
					   PACKAGE_VERSIONS pv
				 WHERE osc.OS_ID = os.OS_ID
				   AND os.NODE_ID = nn.NODE_ID
				   AND bc.NODE_ID = nn.NODE_ID
				   AND osc.PROD_ID = pv.PV_ID
				   
				   AND bc.BOM_ID = :BOM_ID	
			   ) oldbom
		 WHERE newbom.PK = oldbom.PK (+) 
		   AND newbom.PROD_ID = oldbom.PROD_ID (+)
		    AND ( oldbom.PROD_ID = newbom.PROD_ID   )
ORDER BY (newbom.PKG_NAME)
	
	
	
		
		
		  
		   