how to check duplicated records (combitation of 3 fields)

  • Dear all,

    I have this table: [machine_bods]

    I would like to see if there is something repeated between this 3 fields:

    a.machine_number,

    a.bmb_market_id,

    a.valid_from

    I mean, I would like to see if I have more than one record with the same information on those 3 fileds.

    Is the below query ok?

    select

    a.machine_number,

    a.bmb_market_id,

    a.valid_from,count(*)

    from

    [ARF_DBW].[bmb_ms].[machine_bods] a

    group by

    a.machine_number, a.bmb_market_id,a.valid_from

    having count(*) >1

    order by bmb_market_id, machine_number

  • That seems correct. Have you tried it?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply