萬盛學電腦網

 萬盛學電腦網 >> 數據庫 >> oracle教程 >> oracleCONNECTBYPRIOR葉子節點查找根節點

oracleCONNECTBYPRIOR葉子節點查找根節點

   SELECT TRANS_ID

  FROM TRANS_INST

  WHERE connect_by_isleaf=1

  START WITH TRANS_ID =480242

  CONNECT BY PRIOR UP_TRANS_ID = TRANS_ID;

  說明:

  表TRANS_INST(TRANS_ID,UP_TRANS_ID)

  480242表示樹的任何一個節點

  TRANS_ID子節點

  UP_TRANS_ID父節點

copyright © 萬盛學電腦網 all rights reserved