Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: SQL request

  1. #1
    Regular Coder
    Join Date
    Dec 2002
    Location
    France
    Posts
    522
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SQL request

    I have the following table (access 2000) for categories >>>

    id_category
    level
    id_categorySup
    categoryName


    now I want to get a list (select) of level 2 >>>

    SELECT id_category AS id, id_categorySup & " : " & categoryName AS name
    FROM category
    WHERE level=2

    then I get something like >>>

    <option value="24">4 : Office</option>

    but in my Table : 4 = Software , how can I do a request to get >>>

    <option value="24">Software : Office</option>

    ?

    thank you

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    Code:
    SELECT a.id_category AS id,
                 b.id_categoryName & " : " & a.categoryName AS name
    FROM    category a,
                 category b
    WHERE  level = '2'
    AND       a.id_categorySup = b.id_category
    This is a poor way to do a join but it works
    not sure if the columns name are right with the way you are pulling info, but I think it should work.
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    Regular Coder
    Join Date
    Dec 2002
    Location
    France
    Posts
    522
    Thanks
    0
    Thanked 0 Times in 0 Posts

    !!!!!!!!!!!!!!!!!!!

    can't believe it !!!!!!!!!!!!!!!!!!!!!
    a wonder !

    it works ! mamamammiaa it works !

    thanks a ton


  •  

    Posting Permissions

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