ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Hierarchical SQL
Subject:   How about using integer type for path?
Date:   2004-08-19 01:44:10
From:   Carfield Yim
I think we can integer type for path, let say we allow 100 organizations in same level. We can multiply 100 for each level of organization like:


Albert
/ \
/ \
Bert Chuck
/ | \
/ | \
/ | \
Donna Eddie Fred


Personnel_OrgChart
emp_name emp_id path
===============================
'Albert' 'A' 10000
'Bert' 'B' 100
'Chuck' 'C' 200
'Donna' 'D' 201
'Eddie' 'E' 202
'Fred' 'F' 203


Then we can select all item under under 'C' as:
select * from Personnel_OrgChart where path > 200 and path < 300


And all the other operation can do in interger calculation. How do you think about this? As it don't involve String operation, will it run much faster?


1 to 1 of 1
  1. How about using integer type for path?
    2004-08-19 05:21:31  --CELKO-- [View]

1 to 1 of 1