text: SELECT
  	F1.CODIGO,
  	(F1.FRENTE_1||' X '||F2.FRENTE_2) AS FRENTE,
  	TO_NUMBER(F1.FRENTE_1) AS FRENTE_1, 
      F1.FRENTE_1_REAL_M,
      TO_NUMBER(F2.FRENTE_2) AS FRENTE_2, 
      F2.FRENTE_2_REAL_M,
      TO_NUMBER(A1.ALTO) AS ALTO, 
      A1.ALTO_REAL_M
  FROM
  	(SELECT
  		DISTINCT(CODIGO||SUBSTR(PAN.FRENTE,0,2)) as FKEY_1,
  		PAN.CODIGO,
  		SUBSTR(PAN.FRENTE,0,2) AS FRENTE_1,
  		TAM.VNOMINAL AS FRENTE_1_NOMINAL,
  		TAM.VREAL/1000 AS FRENTE_1_REAL_M
  	FROM 
  		BR_COD_FREN_ALT_PAN PAN,
  		BR_TAMANOS TAM 
  	WHERE 
  		SUBSTR(PAN.FRENTE,0,2)=TAM.VNOMINAL 
  		AND 
  		TAM.TIPO = 'FPG'
  		AND
  		SUBSTR(PAN.FRENTE,3,4) Is not null) F1,
     (SELECT
  		DISTINCT(CODIGO||SUBSTR(PAN.FRENTE,3,4)) as FKEY_2,
  		PAN.CODIGO,
  		SUBSTR(PAN.FRENTE,3,4) AS FRENTE_2,
  		TAM.VNOMINAL AS FRENTE_2_NOMINAL,
  		TAM.VREAL/1000 AS FRENTE_2_REAL_M
  	FROM 
  		BR_COD_FREN_ALT_PAN PAN,
  		BR_TAMANOS TAM 
  	WHERE 
  		SUBSTR(PAN.FRENTE,3,4)=TAM.VNOMINAL 
  		AND 
  		TAM.TIPO = 'FPG'
  		AND
  		SUBSTR(PAN.FRENTE,3,4) Is not null) F2,
      (SELECT 
          DISTINCT(CODIGO||PAN.ALTO) as HKEY_1, 
          PAN.CODIGO,
  		PAN.ALTO AS ALTO,
  		TAM.VNOMINAL AS ALTO_NOMINAL,
  		TAM.VREAL/1000 AS ALTO_REAL_M
          FROM 
              BR_COD_FREN_ALT_PAN PAN, 
              BR_TAMANOS TAM 
          WHERE 
          PAN.ALTO=TAM.VNOMINAL  
          AND 
          TAM.TIPO = 'APG') A1
  WHERE
  	F1.CODIGO = F2.CODIGO
  	AND
  	A1.CODIGO = F1.CODIGO
  ORDER BY 
  F1.CODIGO, 
  (F1.FRENTE_1||' X '||F2.FRENTE_2), 
  A1.ALTO;