Simple SQL query to get duplicate values in a table

This is simple T-SQL query to find duplicate values in Microsoft SQL Server Database

select a.field1, a.field2,a.field3, a.field4
    from table a
     where 1 < (select count(*)
      from table b
        where b.field1 = a.field1
          and b.field2 = a.field2
          and b.field3 = a.field3)

28 Comments

  • kamine sahi to likh deta

  • This is really helpful. Worked on Oracle as well

  • Retrive duplicate value from table in sql

  • a mai kya hai? b mai kya hai? a aur b mai kya relation hai yeh kaun batayega?

  • koi relation nahi hai bhosi ke

  • That the wolf-pack retrace their steps through strip
    clubs, tattoo parlors and cocaine-dealing monkeys on that the streets of Bangkok because they try and
    find Teddy before that the wedding.

  • nit a use this code..

  • how to use query in sql server for searching repeating values in data base

  • I know this if off topic but I'm looking into starting my own blog and was curious what all is needed to get set up? I'm assuming having a blog like yours would cost a pretty penny?
    I'm not very web savvy so I'm not 100% positive. Any tips or advice would be greatly appreciated. Thank you

  • With havin so much content do you ever run into any problems of plagorism or copyright infringement?
    My blog has a lot of exclusive content I've either written myself or outsourced but it seems a lot of it is popping it up all over the internet without my authorization. Do you know any techniques to help prevent content from being stolen? I'd genuinely appreciate it.

  • Hey, in simple terms difficult something like some blogs, seems an first-rate platform you will be real via. Im nowadays via WordPress a couple of of my sites however in search of to vary one of them to the situate a platform a lot like yours for a trial run. Something specifically you should evoke regarding this?

  • Your way of describing everything in this post is truly nice, all be able to easily be aware of it, Thanks a lot.

  • I like what you guys tend to be up too. This kind of clever work and exposure!
    Keep up the terrific works guys I've added you guys to my own blogroll.

  • I'm amazed, I have to admit. Rarely do I come across a blog that's both equally educative and amusing, and without a doubt, you have hit the nail on the head.

    The issue is something which too few men and women are speaking intelligently about.
    Now i'm very happy that I found this in my search for something regarding this.

  • It's awesome in support of me to have a website, which is helpful for my experience. thanks admin

  • Why people still use to read news papers when in this technological world everything is existing on net?

  • This is a great tip especially to those new to the blogosphere.

    Simple but very precise information… Many thanks for sharing this one.
    A must read article! The movement from horror based games
    started with Resident Evil 4 which still managed to entertain us and cause a hugely positive effect
    around gamers, it wasn't until RE5 that really changed the way the game was played due to the forced cooperation of the game. net with content available to users once the game launches. Or is the falloff of sales based on another factor, such as the consoles themselves being old and almost spent.

  • If some one wants expert view concerning blogging and site-building afterward i recommend him/her to pay a visit this
    web site, Keep up the fastidious work.

  • Fabulous, what a weblog it is! This weblog gives helpful facts to us, keep it up.

    If it really is for a wedding or any other huge event you
    must search for makes like Dom Perignon or Perrier-Jouet, if you just want to attraction a girl the champagne makes
    won't win her around, she'll be much more interested in the pretty rose colour,
    so you don't want to spend income on anything excessively fussy. Hearing: Sophie the giraffe squeaks, so therefore it will keep your baby entertained and can help demonstrate cause and effect. In order for your dog to retrieve and enjoy the treat, the ball needs to be rolled over in a right order.

  • Hello, yup this paragraph is actually nice and I
    have learned lot of things from it on the topic of blogging.
    thanks.

  • constantly i used to read smaller articles or reviews which
    as well clear their motive, and that is also happening with this paragraph which I am reading at this time.

  • Nice respond in return of this difficulty with firm arguments and describing everything on the
    topic of that.

  • Howdy! Would you mind if I share your blog with my twitter group?
    There's a lot of folks that I think would really enjoy your content. Please let me know. Thanks

  • Hi, its fastidious post about media print, we all understand media is a enormous source
    of facts.

  • Amazing! Its really amazing post, I have got
    much clear idea regarding from this post.

  • You are so awesome! I don't believe I've truly read anything like that
    before. So good to find someone with a few original thoughts on this subject.
    Really.. thanks for starting this up. This website is one thing that's needed on the internet, someone with a little originality!

  • Great blog here! Also your web site loads up fast! What host are you using?
    Can I get your affiliate link to your host? I wish
    my site loaded up as quickly as yours lol

  • Howdy! This is my first visit to your blog! We are a group of volunteers
    and starting a new initiative in a community in the same niche.
    Your blog provided us useful information to work on.
    You have done a extraordinary job!

Comments have been disabled for this content.