www.webdeveloper.com
Results 1 to 2 of 2

Thread: JOIN table to itself - complex query - writers block

  1. #1
    Join Date
    Dec 2002
    Location
    St. Louis, MO, USA
    Posts
    1,582

    JOIN table to itself - complex query - writers block

    Hello, all.

    I've got a table in a SQL 2000 server that is used for navigation. It contains three tiers of navigation; primary, secondary, tertiary. I'll post a basic example of it.
    Code:
    =========================================================
    | ID | nav_name       | nav_parent | URL                               | active |
    =========================================================
    |   0| Home            |      0      | index.cfm                       |   Y     |
    -------------------------------------------------------------------------
    |   1| Get Started   |      0      | NULL                    |   Y     |
    -------------------------------------------------------------------------
    |   2| Install           |      1      | start.cfm?m=install          |   Y     |
    -------------------------------------------------------------------------
    |   3| Setup            |      1      | start.cfm?m=setup          |    Y     |
    -------------------------------------------------------------------------
    |   4| Register          |       3      | register.cfm                  |    Y    |
    -------------------------------------------------------------------------
    |   5| Pick a Project   |       0      | NULL                  |   Y     |
    -------------------------------------------------------------------------
    |   6| Find Available   |      5       | NULL                  |    Y    |
    -------------------------------------------------------------------------
    |   7| Category         |     6      | start.cfm?m=project&s=cat |    Y    |
    --------------------------------------------------------------------------
    |   8| Type              |     6      | start.cfm?m=project&s=typ |    Y    |
    --------------------------------------------------------------------------
    I'm trying to create a query that will get nav_name, regardless of whether or not URL is null, based upon the filename that is passed (index, start, register), so it needs to look at parent navs.

    I started doing this, but keep getting blocked. It works if the 2nd tier nav has a URL, but if it doesn't, then I can't seem to make it look for either 1st tier (if not null) or 3rd tier (if 1st tier AND 2nd tier are NULL).

    Any suggestions?

    thanks,

    ^_^

  2. #2
    Join Date
    Dec 2002
    Location
    St. Louis, MO, USA
    Posts
    1,582
    Nevermind. I'm scrapping this part of the project. Too many things to do, and not enough hours in the day.

    ^_^

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles