Question: Mysql selects all case from three IN() i need to select only: 3, 204, 68 | 3, 204, 69 | 49, 230, 2 | 49, 230, 3 

```
SELECT * FROM rates r
WHERE 1 = 1
AND r.active = 1
AND r.client_id IN (3,3,49,49)
AND r.mcc       IN (204,204,230,230)
AND r.mnc       IN (68,69,2,3)

```

Not like that :

[![enter image description here](https://i.stack.imgur.com/NJD5c.png)](https://i.stack.imgur.com/NJD5c.png)

How to get like this: `client_id = 3 AND mcc = 204 AND mnc = 68` also `client_id = 3 AND mcc = 204 AND mnc = 69`
thai is all for client\_id = 3

Answer: 
You can use the [Object.getPrototypeOf](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf) function.

Something like:

```
class A {
    constructor() {}
}

class B extends A {
    constructor() {
        super();
    }
}

class C extends B {
    constructor() {
        super();
    }
}

var a = new A();
var b = new B();
var c = new C();

Object.getPrototypeOf(a); // returns Object {}
Object.getPrototypeOf(b); // returns A {}
Object.getPrototypeOf(c); // returns B {}

```

---

### Edit

[After the code](http://www.typescriptlang.org/play/#src=function%20CustomDecorator(data%3A%20any)%20%7B%0D%0A%20%20return%20function%20(target%3A%20Function)%20%7B%0D%0A%09console.log(target)%3B%0D%0A%20%20%09console.log(Object.getPrototypeOf(target))%3B%0D%0A%20%20%7D%0D%0A%7D%0D%0A%0D%0Aclass%20AbstractClass%20%7B%0D%0A%20%20name%3A%20string%3B%0D%0A%7D%0D%0A%0D%0A%40CustomDecorator(%7B%7D)%0D%0Aclass%20SubClass%20extends%20AbstractClass%20%7B%0D%0A%0D%0A%7D) @DavidSherret added (in a comment), here's what you want (I think):

```
export function CustomDecorator(data: any) {
  return function (target: Function) {
    var parentTarget = target.prototype;
    ...
  }
}

```

Or as @DavidSherret noted:

```
function CustomDecorator(data: any) {
  return function (target: Function) {
    console.log(Object.getPrototypeOf(new (target as any)));
  }
}

```

---

### 2nd Edit

Ok, so here's what I hope to be you goal:

```
function CustomDecorator(data: any) {
    return function (target: Function) {
        var parentTarget = Object.getPrototypeOf(target.prototype).constructor;
        console.log(parentTarget === AbstractClass); // true :)
    }
}

```
For me following construct worked for getting base type constructor from a type constructor:

```js
class Validator {
    constructor(private readonly ctr: ConstructorFunction<T>) {
        this.id = ctr.name;
        //...
        let protoRef = ctr['__proto__'] as Function;
        this._inheritFrom = protoRef && protoRef !== Object ? protoRef.name : null;
        this._inheritsFromValidator = null;
        //...
    }
}

```

Yeah this is not sound as fancy as smth as `ctr.getBaseClassConstructor()` a-la

```
type BaseType<T> = [some-magic]<T>
function getBasicType<T>():BaseType<T>;

```

but that trick with `__proto__` work.