Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2009
    Posts
    12

    Unanswered: Select Statement For Menu System

    Hi all - not sure if this post should be put here or in the ASP forum!
    I'm trying to do a select statement or statements to filter my database to create a product menu system for my website.
    The menu has four main categories with sub categories and sub sub categories.
    I have a 'view' in MS SQL that gives me the results in the screen grad attached.
    As you can see, the lineage and depth shows the hierarchy of the sections, sub sections and sub sub sections.
    So the info is there, but i don't know how to do the select statement for the menu.

    Hope that makes some sense.

    Thanks in advance
    Andy
    Attached Thumbnails Attached Thumbnails db_sg.jpg  

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    You need to be a little more clear about what you need. Expected results etc... Your thumbnail appears to have a hierarchyid in it. Do you know about trees and hierarchies? Check these links out...

    Let me google that for you
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Oct 2009
    Posts
    12
    Thanks Thrasymachus - I need to get the menu sections grouped. For instance - all the sub headers for the 'Electrical' section (lineage 14).
    One of these sub headers is '17th edition' so i need all the sub sub section of that (lineage 18).

  4. #4
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    ok. click on the link in my last post and read about trees and hierarchies.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

Posting Permissions

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