ANSI JOIN ORACLE,带2个通用表

bfhwhh0e  于 2023-03-29  发布在  Oracle
关注(0)|答案(1)|浏览(152)

我想在Oracle上使用ANSI JOIN来实现:

SELECT *
   FROM TICKET,
        --here I have more tables that relates with TICKET
        TICKET_EVO,
        USER USR_CLIENT,
        USER USR_SUPPORT
 WHERE TICKET.ID = TICKET_EVO.ID --TICKET_EVO is child of TICKET
   AND TICKET.CD_USER = USR_CLIENT.CD_USER --TICKET has the client user that opened the ticket
   AND TICKET_EVO.CD_USER = USR_SUPPORT.CD_USER --TICKET_EVO has the support user that answer the client on each evolution

谢谢大家!

oxiaedzo

oxiaedzo1#

SELECT *
FROM TICKET 
JOIN TICKET_EVO 
  ON TICKET.ID = TICKET_EVO.ID
JOIN USER USR_CLIENT
  ON TICKET.CD_USER = USR_CLIENT.CD_USER
JOIN USER USR_SUPPORT
  on TICKET_EVO.CD_USER = USR_SUPPORT.CD_USER

相关问题