Question: I have a user table, the important columns are these.

```
id | logintime
---+-----------
1  | 2004-01-10
2  | 2006-02-10
3  | 2005-03-12
4  | 2006-10-23

```

I want to create a column that approximates time the user registered. To do this I want to take the lowest logintime on id and every id larger than itself. the logintime is the last time the id has logged into the site.

While it is not perfect, it gives a "latest possible date" for the registertime. Since id is autoincrement we know that the person with id 2 has registered before the person with id 3, so we approximate the registertime for id 2 with the logintime for id 3.

The result would be 

```
id | logintime  | Registertime
---+------------+-------------
1  | 2004-01-10 | 2004-01-10
2  | 2006-02-10 | 2005-03-12
3  | 2005-03-12 | 2005-03-12
4  | 2006-10-23 | 2006-10-23

```

Can I do this with one query? I think I can achieve it with a t-cursor, but that seems a bit too fancy for this, simple, task.

**Edit**: Clarified the question.

Answer: 
Here it is.

```
class ParentComponentController {
  public parentMethod(param1: number, param2: string): boolean {
    return param1 > 0 && param2.length > 2;
  }
}

class ChildComponentController {
  constructor(private parentMethod: typeof ParentComponentController.prototype.parentMethod) {}

  public onCertainTrigger() {
    this.parentMethod(10, 'something');
  }
}

```
As you have already declared a `type` `parentMethod`, you may also do something like below:

```
declare type parentMethod = (param1: number, param2: string) => boolean;

class ParentComponentController {

  //this is now a field of type parentMethod 
  public parentMethod: parentMethod = (param1: number, param2: string) =>
    param1 > 0 && param2.length > 2;
}

class ChildComponentController {
  constructor(private parentMethod: parentMethod) { }

  public onCertainTrigger() {
    this.parentMethod(10, 'something');
  }
}

new ChildComponentController(new ParentComponentController().parentMethod)
  .onCertainTrigger();

```

Here is the fiddle link for your referecne: <https://jsfiddle.net/sayan751/ttmzzkg9/>