The table looks like this
RELATION_ID OBJECT_ID RELATED_TO_OBJECT_ID CLASS_ID RELATION_TYPE_ID
7966561 910675 69305 7 1
7966562 910675 439104 7 1
The OBJECT_ID value 910675
has two related OBJECT_ID values in RELATED_TO_OBJECT_ID. I would like to find the top 400 OBJECT_IDs having the most RELATED_TO_OBJECT_ID records and also where CLASS_ID = 7 and RELATION_TYPE_ID = 1
.