Hierarchical queries อันนี้จริงๆเป็น Feature ลับของทาง Oracle ครับ โดยนำมาช่วยให้สามารถ Query ข้อมูลยาก และซับซ้อนได้ง่ายขึ้นครับ เช่น มีข้อมูล Company อยากรู้ว่า Company รายการนี้ มีบริษัทลูกกี่ตัว เป็นต้นครับ (อันนี้เดี๋ยวของไปเขียน Blog ยกอีกตอนครับ หุหุ)

สำหรับการเปิดใช้ Feature Hierarchical queries สามารถใช้คำสั่งง่ายๆ ดังนี้
db2set DB2_COMPATIBILITY_VECTOR=08 db2stop db2start
ข้อควรระวัง: การเปิดใช้ Hierarchical queries นั้นช่วยให้สามารถ Query ข้อมูลแบบลำดับขั้นได้แล้ว แต่ Performance ของ DB จะช้าลงด้วยนะครับ และ SQL จะมีรูปแบบพิเศษ ทำให้ยากต่อการ Port ไป DBMS ตัวอื่นๆ
Reference: Hierarchical Queries
Discover more from naiwaen@DebuggingSoft
Subscribe to get the latest posts sent to your email.