Question: When an **ItemView** is listening to a model other than its model (this.model), do I simply need to turn off listeners within the **remove** function? And set their reference to null? I wonder if the **ItemView** will be safely destroyed, or if I'll be in trouble later when tons of views like this will be created / destroyed? 

Example :

```
var FriendListItemView = Marionette.ItemView.extend({
    [...]
    initialize: function(){
        Marionette.ItemView.prototype.initialize.apply(this, arguments);
        // get the friend and the user from global "users" collection
        this.user = users.get(this.model.get('user_id'));
        this.friend = users.get(this.model.get('friend_id'));
        this.user.on('change:name', this.render, this);
        this.friend.on('change:name', this.render, this);
    },
    remove: function(){
        this.user.off('change:name', this.render, this);
        this.friend.off('change:name', this.render, this);
        this.user = null;
        this.friend = null;
        Marionette.ItemView.prototype.remove.apply(this, arguments);
    },
});

```

Answer: 
you could try this,

```
select some_name,some_number from yourTable  t 
where 
(select count(*) from yourTable 
where 
some_number<=t.some_number and some_name=t.some_name)<3

```
This partially solved my problem:

```
set @num := 0, @name := '';

select distinct number, name
from (
  select number, name,
     @num := if(@name = name, @num +1, 1) as row_number,
      @name := name as dummy
     from karian2

     ) as x where x.row_number <= 2;

```

It fails some time to return 2 results because sub query is not returning distinct values. Example here:
<http://sqlfiddle.com/#!2/952ca/23>