Oracle
 sql >> Database >  >> RDS >> Oracle

C'è un modo per dare a una sottoquery un alias in Oracle 11g SQL?

Puoi dare a una query un nome o un alias con CTE (Common Table Expressions) alias clausola WITH alias Oracle come Subquery Factoring:

WITH abc as (select client_ref_id, request from some_table where message_type = 1)
select * 
from abc
    inner join 
    (select client_ref_id, response  from some_table where message_type = 2) defg
       on abc.client_ref_id = def.client_ref_id;