Is there a way to give a subquery an alias in Oracle 11g SQL?

后端 未结 3 1549
春和景丽
春和景丽 2021-02-07 04:44

Is there a way to give a subquery in Oracle 11g an alias like:

select * 
from
    (select client_ref_id, request from some_table where message_type = 1) abc,
            


        
3条回答
  •  野性不改
    2021-02-07 05:32

    I don't have an Oracle instance to test with, but what you posted should be valid ANSI-89 JOIN syntax. Here it is in ANSI-92:

    SELECT *
      FROM (SELECT client_ref_id, request 
              FROM SOME_TABLE 
             WHERE message_type = 1) abc
      JOIN (SELECT client_ref_id, request 
              FROM SOME_TABLE 
             WHERE message_type = 1) defg ON defg.client_ref_id = abc.client_ref_id
    

提交回复
热议问题