Filter duplicate value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Frank Turc
    New Member
    • Jan 2012
    • 2

    Filter duplicate value

    how can I get the dm_partie unique on my SELECT query

    SELECT DISTINCT Dm_partie,No_Me mbr,No_Advers FROM Parties_Simple AS PS
    ORDER BY Dm_partie

    Dm_partie No_Membr No_Advers
    2010-10-03 14:27:40.000 07020 09030
    2010-10-03 14:27:40.000 09030 07020
    2010-10-03 14:27:42.000 09030 04038
    2010-10-03 14:27:42.000 04038 09030

    I would like to have

    Dm_partie No_Membr No_Advers
    2010-10-03 14:27:40.000 07020 09030
    2010-10-03 14:27:42.000 09030 04038
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Which No_Advers would you pick between the two?


    ~~ CK

    Comment

    • Frank Turc
      New Member
      • Jan 2012
      • 2

      #3
      Originally posted by ck9663
      Which No_Advers would you pick between the two?


      ~~ CK
      the first one that is not equal to No_Membr

      Thanks for your help

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        I see no field(s) that define a record as the "first" one. And without such field(s), it'll be a little random which one you get.

        Comment

        • ck9663
          Recognized Expert Specialist
          • Jun 2007
          • 2878

          #5
          If there are only two sets of records and your trying to get the one where No_Membr <> No_Advers why not just use that condition.

          Code:
          WHERE No_Membr <> No_Advers

          Happy Coding!!!


          ~~ CK

          Comment

          Working...