sql - Query to find duplicate values for two fields -


Sorry for the title, but do not know how to explain I have a table that has 2 fields A and B. I should get all the rows in the table that are duplicate A (more than one record), but also the e will consider only as a duplicate if B is different in both rows Example:
  FIELD A field B10 10 10 10 // This is not a duplicate 10 10 10 5 // This is a duplicate   

How to do this in a single query

FIELD count from your_table group (B) & gt; 1

Keep in mind that this will return the count of all duplicate instances if you have 1 1 2 1 value, then this value will not be 1 2

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -