Nested sort
- From: Bob Stearns <rstearns1241@xxxxxxxxxxx>
- Date: Wed, 28 Sep 2005 18:00:45 -0400
I have a table (see below for ddl) which implements a set of locations for an organization, from the whole organization to shelves in a particular room. Users never see the primary key, only the NAMEX, usually as a drop down selection list, sometimes a single selection other times a multiselection. Users, being users, want the ability to change names and to see the names in sorted order at each level. If I didn't have to have changeable names, I could define the data in alphabetic order. Given that I can't do that, is there (relatively) easy way to present the data in a sorted manner?
CREATE TABLE IS3.LOCATIONS (
LOC_ID INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20) NOT NULL,
NAMEX VARCHAR(30) NOT NULL,
LEFTX INTEGER NOT NULL,
RIGHTX INTEGER NOT NULL,
ENTITY_ID INTEGER NOT NULL,
INACTIVE CHARACTER(25),
PRIMARY KEY(LOC_ID)
)
GO
ALTER TABLE IS3.LOCATIONS
ADD CONSTRAINT INACTIVE
CHECK (INACTIVE in ('Y','N'))
GO
ALTER TABLE IS3.LOCATIONS
ADD CONSTRAINT SQL040717191150980
FOREIGN KEY(ENTITY_ID)
REFERENCES IS3.ENTITIES_PUB(ENTITY_ID)
ON DELETE NO ACTION
ON UPDATE NO ACTION
GO
.
- Follow-Ups:
- Re: Nested sort
- From: JOG
- Re: Nested sort
- From: Hugo Kornelis
- Re: Nested sort
- Prev by Date: Re: Database design, Keys and some other things
- Next by Date: Re: Nested sort
- Previous by thread: Encoding materialized path in an atomic value.
- Next by thread: Re: Nested sort
- Index(es):
Relevant Pages
|