Re: A tree of location and site names..



On Fri, 13 May 2005 08:22:02 -0700, Rhonda Fischer wrote:

>Hello,
>
>This is a tuff one not sure if it can be done with an SQL query, I'm
>thinking along the lines of an inner join, but I'm not really sure.
(snip)

Hi Rhonda,

Sorry for the late reply.

I'm not sure what exactly you're asking. Your message doesn't appear to
have any specific question. Are you looking for generic advice if your
solution is the best one for your problem? Or do you actually need a
query to do a specific job?

In the latter case, please repost. I'd appreciate it if you'd post the
table structure as a CREATE TABLE statement (including all constraints
and properties - any irrelevant columns may be left out, though) and the
sample data as INSERT statements. Also, post the output you'd like to
get from the sameple data.
Check www.aspfaq.com/5006 for some useful hints on how to post.

If you're looking for generic advice on how to deal with hierarchies,
then your best bet is to buy and read "Trees and Hierarchies in SQL" by
Joe Celko. This book describes several ways to model a hierarchy in SQL,
with their pros and cons.

You could also google for "nested sets model" and "adjacency list model"
to find information about two of the most common ways to represent a
hierarchy.

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)
.



Relevant Pages

  • Re: A tree of location and site names..
    ... >>This is a tuff one not sure if it can be done with an SQL query, ... Are you looking for generic advice if your ... > sample data as INSERT statements. ... > then your best bet is to buy and read "Trees and Hierarchies in SQL" by ...
    (microsoft.public.sqlserver.mseq)
  • Re: Equivalent of Get Next Extended to retrieve only unique keys?
    ... The only real "extra" stuff is pertaining to SQL query optimization. ... Bill Bach wrote: ... Retaining the ability to filter on multiple>> items would probably ...
    (comp.databases.btrieve)
  • Re: Setting a Default Value
    ... the make the Sql call from within Application_Start in Global.asax. ... the query string value each time I needed to ... going to assign the default value through a database query. ... run the following SQL query: select * from table where x = 1 ...
    (microsoft.public.dotnet.framework.aspnet)
  • Hierarchy as UP constraint
    ... book (Joe Celko's “Trees and hierarchies in SQL for smarties“) have been written about hierarchies and relational databases, mostly on how to implement hierarchies in tables. ... PNR has a special foreign key-like constraint, ... and in the container interpretation: ...
    (comp.databases.theory)
  • Re: MultiSelect Property
    ... > For Each vItm In Me!lbSelectContract.ItemsSelected ... > Dim stCriteria As String ... >> SQL query). ... >> the multiselect list box appears in the SQL query. ...
    (microsoft.public.access.devtoolkits)