By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
select * from V$VERSION;
BANNER |
---|
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production |
PL/SQL Release 11.2.0.2.0 - Production |
CORE 11.2.0.2.0 Production |
TNS for Linux: Version 11.2.0.2.0 - Production |
NLSRTL Version 11.2.0.2.0 - Production |
with table_a (area_id, loc_id ) as
(select 111, 1 from dual union all
select 222, 2 from dual union all
select 333, 3 from dual
),
table_b (loc_id, loc_name) as
(select 1, 'USA' from dual union all
select 2, 'ITALY' from dual union all
select 3, 'SPAIN' from dual
)
select a.area_id, b.loc_name as name
from table_a a
cross join table_b b
where b.loc_id = 1
AREA_ID | NAME |
---|---|
111 | USA |
222 | USA |
333 | USA |
with table_a (area_id, loc_id ) as
(select 111, 1 from dual union all
select 222, 2 from dual union all
select 333, 3 from dual
),
table_b (loc_id, loc_name) as
(select 1, 'USA' from dual union all
select 2, 'ITALY' from dual union all
select 3, 'SPAIN' from dual
)
select a.area_id, b.loc_name as name
from table_a a
join table_b b
on b.loc_id = 1
AREA_ID | NAME |
---|---|
111 | USA |
222 | USA |
333 | USA |