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');
  }
}

```
You can create a type alias with a namespace which isn't terribly great but will work:

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

class ChildComponentController {
  // This results in an error
  constructor(private parentMethod: ParentComponentController.parentMethod) {}

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

```

Note that interfaces, as well as type aliases, do not exist at run-time. They are merely a design time construct.