SQL Join table Alias

This commit is contained in:
2021-01-07 14:59:36 +01:00
parent 810f51bdcc
commit fae8a71bac
5 changed files with 61 additions and 9 deletions

View File

@@ -40,13 +40,13 @@ class Select extends Query {
return $this;
}
public function innerJoin($table, $columnA, $columnB) {
$this->joins[] = new Join("INNER", $table, $columnA, $columnB);
public function innerJoin($table, $columnA, $columnB, $tableAlias=null) {
$this->joins[] = new Join("INNER", $table, $columnA, $columnB, $tableAlias);
return $this;
}
public function leftJoin($table, $columnA, $columnB) {
$this->joins[] = new Join("LEFT", $table, $columnA, $columnB);
public function leftJoin($table, $columnA, $columnB, $tableAlias=null) {
$this->joins[] = new Join("LEFT", $table, $columnA, $columnB, $tableAlias);
return $this;
}