sql question: select distict help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • leegold2

    #1

    sql question: select distict help

    say I'm selecting distinct (non-duplicate) rows for insertion,

    insert into original_table select distinct * from new_table

    these tables have 3 fields/row. Per the above code all 3 fields are
    evaluated by "distict *" .

    But my question is: I want to ignore field1, therefore I only want to
    test if any rows have field2 *and* field3 as dups - that would be my
    distinct test. Test f2 and f3, not f1.

    What the sql? Help is greatly appreciated.
  • CryingClinton

    #2
    Re: sql question: select distict help

    "leegold2" <leegold@nospam .net> ????
    news:hjUTc.4548 $Kf4.3941@nwrdd c02.gnilink.net ...[color=blue]
    > say I'm selecting distinct (non-duplicate) rows for insertion,
    >
    > insert into original_table select distinct * from new_table
    >
    > these tables have 3 fields/row. Per the above code all 3 fields are
    > evaluated by "distict *" .
    >
    > But my question is: I want to ignore field1, therefore I only want to
    > test if any rows have field2 *and* field3 as dups - that would be my
    > distinct test. Test f2 and f3, not f1.
    >
    > What the sql? Help is greatly appreciated.[/color]

    SELECT * FROM table GROUP BY field2,field3


    --
    http://www.vicdir.com


    Comment

    Working...