January 16, 2009 at 3:33 am
Hello!
Problem is to sort from High to Low or from Up to Down!
Have table like this:
CREATE TABLE #PUC
(
CODE CHAR(3),
POSITION VARCHAR(30),
GRADE INT
)
INSERT INTO #PUC
SELECT '100', 'ABOSS', 10 UNION ALL
SELECT '101', 'A1', 9 UNION ALL
SELECT '102', 'A2', 8 UNION ALL
SELECT '200', 'BBOSS', 10 UNION ALL
SELECT '201', 'B1', 9 UNION ALL
SELECT '202', 'B2', 8
And I want to see my results like this
CODE |POSITION |Grade| Hierarchy
100ABOSS10 -
101A1 9 ABOSS
102A2 8 ABOSS - A1
200BBOSS10 -
201B1 9 BBOSS
202B2 8 BBOSS - B1
January 16, 2009 at 6:29 am
Hi,
I am struggling to understand your example so perhaps you could qualify it a little further please.
What relates (ABOSS) to (A1) in order to create (ABOSS - A1)? Does the code denote the hierarchy?
Cheers,
January 16, 2009 at 7:07 am
ABOSS is BOSS of A department
A1 is Team Leader of department A
A2 is employee
So
A Boss
A1 Team Leader
A2 Employee
The hierarchy is BOSS >>> BOSS-TeamLeader >>> BOSS-TeamLeader-Employee
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy