Results 1 to 3 of 3

Thread: Newbie Help

  1. #1
    Join Date
    Jan 2003
    Posts
    6

    Unanswered: Newbie Help

    I'm sure htis is easy and I am just not finding it..

    I ahve 2 tables, 1 has a a "parent" item and the other has the children object (1 to many)

    When I select, I get multiple copies of fields in the first table. I would like, for each item, to only get these once.. is it possible?

  2. #2
    Join Date
    Jan 2003
    Location
    Midwest
    Posts
    138
    SELECT DISTINCT field_name FROM table_1

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    norman, if you meant whether you can get the fields from the first table only once when you do a join, the answer is no, sql does not do that

    for example:

    table1
    23 html
    24 css
    25 ssi

    table2
    56 hr 23
    57 margin 24
    58 head 23
    59 elseif 25
    60 float 24
    61 @import 24
    62 p 23

    when you join these tables, the result is

    css @import
    css float
    css margin
    html head
    html hr
    html p
    ssi elseif

    i think you are suggesting that the result be

    css @import
    .... float
    .... margin
    html head
    .... hr
    .... p
    ssi elseif

    and the answer is no

    you have to do that with a reporting program


    rudy
    http://r937.com/

Posting Permissions

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