So close :-)
SQL> select
2 df.tablespace_name
3 ,df_bytes
4 ,used_bytes
5 from
6 (select case when tablespace_name in ('UNDO','SYSTEM','SYSAUX','PERFSTAT') or tablespace_name like 'UNDO%'
7 then tablespace_name else 'Data' end tablespace_name
8 ,trunc(sum(bytes)/1024/1024/1024,2) df_bytes
9 from dba_data_files
10 group by case when tablespace_name in ('UNDO','SYSTEM','SYSAUX','PERFSTAT') or tablespace_name like 'UNDO%'
11 then tablespace_name else 'Data' end) df
12 ,(select case when tablespace_name in ('UNDO','SYSTEM','SYSAUX','PERFSTAT') or tablespace_name like 'UNDO%'
13 then tablespace_name else 'Data' end tablespace_name
14 ,trunc(sum(bytes)/1024/1024/1024,1) usd_bytes
15 from dba_segments
16 group by case when tablespace_name in ('UNDO','SYSTEM','SYSAUX','PERFSTAT') or tablespace_name like 'UNDO%'
17 then tablespace_name else 'Data' end ) ud
18 where ud.tablespace_name(+) = df.tablespace_name
19 union
20 select 'TEMP'
21 , trunc(sum(TABLESPACE_SIZE)/1024/1024/1024,2) TEMP_BYTES
22 , trunc(sum(TABLESPACE_SIZE)/1024/1024/1024 - sum(free_SPACE)/1024/1024/1024,2) TMP_BYTES
23 from dba_temp_free_space T
24 /
,used_bytes
*
ERROR at line 4:
ORA-00904: "USED_BYTES": invalid identifier