SPHPlayground API
SPHPlayground
sphplayground sphplayground

Rowsets

An implementation of RowsetInterface defines a set of database rows that contain columns of data. The Rowset class is an instantiable implementation of RowsetInterface. An instance of Rowsets class is a collection of RowsetInterface objects.

Rowsets is used in Select::from() to define the sets of table(s) from which data is to be retrieved.

Synopsis
interface RowsetInterface implements Stringable
public innerJoin(string $rowset):Join
public leftJoin(string $rowset):Join
public rightJoin(string $rowset):Join

Joins

A JOIN clause combines columns from one or more tables into a new table.[1]

The natural LEFT JOIN of two tables is defined to be semantically equivalent to an INNER JOIN or a LEFT JOIN with a USING clause that names all columns that exist in both tables. [2]

RIGHT JOIN works analogously to LEFT JOIN. To keep code portable across databases, it is recommended that you use LEFT JOIN instead of RIGHT JOIN.

Some essential Join methods:

Synopsis
interface Join implements ValidableSQL
public on(Predicate|string ... $rules):?PredicateSet
public using(string ... $column):static
Returns the generated SQL language string
public __toString():string
Checks the basic validity of the SQL language generated
public isValid():bool