I have model having fields as name, school, email, address etc.
I want to find out the rows for which there is same entry for name
and school
field ?
eg:
name school email
abc mps abc@gmail.com
abc mps abc@gmail.com
xyz vps xyz@gmail.com
abc mps abc@gmail.com
poi vps poi@gmail.com
jkl vps jkl@gmail.com
like for name
abc and school
mps ther are 3 entries and for xyz and vps there are 2 entries
I can nested for
loop and iterative manner to check the name and school fields against all the rows in the table. That would be performance hit (n*n)
Is there any other way to find out ?