sql - MySQL query to find partial duplicates -


I have a table in which I want to find competitors who wrote more than one competition. There are more columns but only looking at those people about whom I am in number first, first_name, last_name, school and competition.

I want to find people in my table who have written more than one competition, so basically first first_name, same last_name, same school, but different competition

make me clear It was supposed that the competition should be equal to 1, I can see competitors from other competitions on the table in the specified 3 competitions, which I have not seen and even duplicates Also to be listed will be beneficial. So if it finds two people who match the criteria, then it shows both.

Edit 2

Some example data ...

  | ID | First_name | Last_name School | Competition | | 01 | Jane | Do | | 2568 | 1001 | | 02 | Mike | Do | | 2568 | 1003 | | 03 | Jane | Do | | 2568 | 1003 | | 04 | Jane | Do | | 2523 | 1001 |  

This example will match the ID 01 and 03, but the other will not be different because the name is different with 02 and the school is different with 04.

  first number, last_name, select school, table WHERE competition ('blah', ' Month ',' wow ') First_name by group, last_name, number of school building (separate competition) & gt; 1  

Edit

  Select Join table (ID) as GROUP_CONCAT (id) first_name, last_name, school, table WHERE contest Contest (1001,1002,1003) Group is having first_name, last_name, running school COUNT (separate competition) & gt; 1) FIND_IN_SET (TD, x.ids)> on x & gt; 0  


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -