I now would like to have a SQL query which gives me the number of
unique object and reference combinations, like this:
d shouldn't be displayed, because it's equal to c. The problem is also that a sequence of object references is
also important. So, for instance, object a shouldn't be equal to object b. The solution should also work is MS SQL and Mysql.