plsql - oracle database, Omitting records from a table which are subset of records in same table based on two columns -


i have customers clustered groups cluster_id , amount of data huge (so performance matter here). simplest form of have following table:

cust_id | cluster_id
---------- | -----------
1 | 1
2 | 1
3 | 1
2 | 2
1 | 2
2 | 3
4 | 3
1 | 4

i want clusters greatest number of customers such no costumer removed. in other words, want delete records of cluster subset of cluster. in above example, output table should this:

cust_id cluster_id
-------- | ----------
1 | 1
2 | 1
3 | 1
2 | 3
4 | 3


Comments

Popular posts from this blog

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -