|
-
Hope this meets the requirement:
CREATE OR REPLACE VIEW TEST_FINALCONTA ( COD_IMM,
COD_RITMI, SOMMA ) AS select cod_imm,
cod_ritmi,
SUM(total_area) somma
from (select cod_imm,
(CASE WHEN cod_ritmi IS NOT NULL
THEN cod_ritmi
ELSE (SELECT MAX(cod_ritmi)
FROM MAX_TEST1CONTA
WHERE max_ritmi in (SELECT MAX(max_ritmi)
FROM MAX_TEST1CONTA) )
END) cod_ritmi,
tipo_spazio,
total_area
from test4)
group by cod_imm, cod_ritmi
Cheers!
OraKid.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|