Setting a distinct value from 2 columns

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Synch
    New Member
    • Feb 2008
    • 1

    Setting a distinct value from 2 columns

    I have a query that results in something like:

    field 1 field 2
    red blue
    green black
    blue red
    orange black

    What I want to do is make it so I only show distinct rows; however I want the distinction/uniqueness based on what's in field 1 and 2.
    In other words, I would like the instance of red,blue(field1 ,field2) and blue,red to be detected as repeated values and thus only display one of those 2 rows.

    resulting in:
    field 1 field 2
    red blue
    green black
    orange black

    Does anyone know how to do this? I thought it would be trivial but I've spent a few hours and havn't been able to figure it out =/

    Thanks.
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    The logic won't let you do what you are thinking of unless I am mistaken. I can't think of any way to achieve what you want without some really complicated code. Even then I'm not sure if its possible.

    Maybe I'm missing something that someone else will pick up on. The way I see this is your record is in the format of Field1, Field2 (e.g. red, black). However, (red, black) is not the same as (black, red) as far as databases are concerned. In other words these are not two duplicate records.

    Comment

    Working...