$stmt = $connection->select();
// SELECT * ...$stmt->distinct();
// SELECT DISTINCT ...SQLServer only.
$stmt->top(10);
// SELECT TOP (10) ...$stmt->top(10)->percent();
// SELECT TOP (10) PERCENT ...$stmt->top(10)->withTies();
// SELECT TOP (10) WITH TIES ...$stmt->columns('c1');
// SELECT c1 ...$stmt->columns('c1', 'c2');
// SELECT c1, c2 ...$stmt->columns(['a' => 'c1', 'b' => 'c2']);
// SELECT c1 a, c2 b ...See Subquery.
$stmt->columns(
$connection->select()
->columns('COUNT(*)')
->from('t1')
->subquery()
->as('count')
);
// SELECT (SELECT COUNT(*) FROM t1) countuse MichaelRushton\Database\SQL;
$stmt->columns(SQL::bind($param));
// SELECT ? ...$stmt->from('t1');
// SELECT ... FROM t1$stmt->from('t1', 't2');
// SELECT ... FROM t1, t2$stmt->from(['a' => 't1', 'b' => 't2']);
// SELECT ... FROM t1 a, t2 bSee Subquery.
$stmt->from(
$connection->select()
->columns('c1')
->from('t1')
);
// SELECT ... FROM (SELECT c1 FROM t1)See Table.
use MichaelRushton\Database\SQL\Components\Table;
$stmt->from(new Table('t1'));
// SELECT ... FROM t1$stmt->join('t2');
// SELECT ... JOIN t2$stmt->join(['t2', 't3']);
// SELECT ... JOIN t2 JOIN t3$stmt->join(['b' => 't2', 'c' => 't3']);
// SELECT ... JOIN t2 b JOIN t3 c$stmt->join('t2', 'c1');
// SELECT ... JOIN t2 USING (c1)$stmt->join('t2', ['c1', 'c2']);
// SELECT ... JOIN t2 USING (c1, c2)$stmt->join('t2', 'c1', 'c2');
// SELECT ... JOIN t2 ON c1 = c2$stmt->join('t2', 'c1', '!=', 'c2');
// SELECT ... JOIN t2 ON c1 != c2$stmt->join('t2', [
'c1' => 'c2',
'c3' => 'c4',
]);
// SELECT ... JOIN t2 ON (c1 = c2 AND c3 = c4)$stmt->join('t2', 'c1', SQL::bind($param));
// SELECT ... JOIN t2 ON c1 = ?
use MichaelRushton\Database\SQL\Components\On;
$stmt->join('t2', function (On $on)
{
$on->on('c1', 'c2')
->on('c3', 'c4');
});
// SELECT ... JOIN t2 ON (c1 = c2 AND c3 = c4)$stmt->join('t2', function (On $on)
{
$on->on('c1', 'c2')
->orOn('c3', 'c4');
});
// SELECT ... JOIN t2 ON (c1 = c2 OR c3 = c4)$stmt->join('t2', function (On $on)
{
$on->onNot('c1', 'c2')
->orOnNot('c3', 'c4');
});
// SELECT ... JOIN t2 ON (NOT c1 = c2 OR NOT c3 = c4)$stmt->join('t2', function (On $on)
{
$on->onIn('c1', ['c2', 'c3'])
->onIn('c4', ['c5', 'c6']);
});
// SELECT ... JOIN t2 ON (c1 IN (c2, c3) AND c4 IN (c5, c6))$stmt->join('t2', function (On $on)
{
$on->onIn('c1', ['c2', 'c3'])
->orOnIn('c4', ['c5', 'c6']);
});
// SELECT ... JOIN t2 ON (c1 IN (c2, c3) OR c4 IN (c5, c6))$stmt->join('t2', function (On $on)
{
$on->onNotIn('c1', ['c2', 'c3'])
->orOnNotIn('c4', ['c5', 'c6']);
});
// SELECT ... JOIN t2 ON (NOT c1 IN (c2, c3) OR NOT c4 IN (c5, c6))$stmt->join('t2', function (On $on)
{
$on->onBetween('c1', 'c2', 'c3')
->onBetween('c4', 'c5', 'c6');
});
// SELECT ... JOIN t2 ON (c1 BETWEEN c2 AND c3 AND c4 BETWEEN c5 AND c6)$stmt->join('t2', function (On $on)
{
$on->onBetween('c1', 'c2', 'c3')
->orOnBetween('c4', 'c5', 'c6');
});
// SELECT ... JOIN t2 ON (c1 BETWEEN c2 AND c3 OR c4 BETWEEN c5 AND c6)$stmt->join('t2', function (On $on)
{
$on->onNotBetween('c1', 'c2', 'c3')
->orOnNotBetween('c4', 'c5', 'c6');
});
// SELECT ... JOIN t2 ON (NOT c1 BETWEEN c2 AND c3 OR NOT c4 BETWEEN c5 AND c6)$stmt->join('t2', function (On $on)
{
$on->onNull('c1')
->onNull('c2');
});
// SELECT ... JOIN t2 ON (c1 IS NULL AND c2 IS NULL)$stmt->join('t2', function (On $on)
{
$on->onNull('c1')
->orOnNull('c2');
});
// SELECT ... JOIN t2 ON (c1 IS NULL OR c2 IS NULL)$stmt->join('t2', function (On $on)
{
$on->onNotNull('c1')
->orOnNotNull('c2');
});
// SELECT ... JOIN t2 ON (NOT c1 IS NULL OR NOT c2 IS NULL)See Subquery.
$stmt->join(
$connection->select()
->columns('c1')
->from('t1')
->subquery()
->as('t2')
);
// SELECT ... JOIN (SELECT c1 FROM t1) t2See Table.
$stmt->join(new Table('t2'));
// SELECT ... JOIN t2$stmt->leftJoin('t2', ...$on);
// SELECT ... LEFT JOIN t2 ...$stmt->rightJoin('t2', ...$on);
// SELECT ... RIGHT JOIN t2 ...$stmt->fullJoin('t2', ...$on);
// SELECT ... FULL JOIN t2 ...MariaDB and MySQL only.
$stmt->straightJoin('t2', ...$on);
// SELECT ... STRAIGHT_JOIN t2 ...$stmt->crossJoin('t2');
// SELECT ... CROSS JOIN t2$stmt->naturalJoin('t2');
// SELECT ... NATURAL JOIN t2$stmt->naturalLeftJoin('t2');
// SELECT ... NATURAL LEFT JOIN t2$stmt->naturalRightJoin('t2');
// SELECT ... NATURAL RIGHT JOIN t2$stmt->naturalFullJoin('t2');
// SELECT ... NATURAL FULL JOIN t2$stmt->where('c1', $param);
// SELECT ... WHERE c1 = ?
$stmt->where('c1', '!=', $param);
// SELECT ... WHERE c1 != ?
$stmt->where([
'c1' => $param1,
'c2' => $param2,
]);
// SELECT ... WHERE (c1 = ? AND c2 = ?)$stmt->where('c1', new Raw('c2'));
// SELECT ... WHERE c1 = c2use MichaelRushtwhere\Database\SQL\Components\Where;
$stmt->where(function (Where $where)
{
$where->where('c1', $param1)
->where('c2', $param2);
});
// SELECT ... WHERE (c1 = ? AND c2 = ?)$stmt->where(function (Where $where)
{
$where->where('c1', $param1)
->orWhere('c2', $param2);
});
// SELECT ... WHERE (c1 = ? OR c2 = ?)$stmt->where(function (Where $where)
{
$where->whereNot('c1', $param1)
->orWhereNot('c2', $param2);
});
// SELECT ... WHERE (NOT c1 = ? OR NOT c2 = ?)$stmt->where(function (Where $where)
{
$where->whereIn('c1', [$param1, $param2])
->whereIn('c2', [$param3, $param4]);
});
// SELECT ... WHERE (c1 IN (?, ?) AND c2 IN (?, ?))$stmt->where(function (Where $where)
{
$where->whereIn('c1', [$param1, $param2])
->orWhereIn('c2', [$param3, $param4]);
});
// SELECT ... WHERE (c1 IN (?, ?) OR c2 IN (?, ?))$stmt->where(function (Where $where)
{
$where->whereNotIn('c1', [$param1, $param2])
->orWhereNotIn('c2', [$param3, $param4]);
});
// SELECT ... WHERE (NOT c1 IN (?, ?) OR NOT c2 IN (?, ?))$stmt->where(function (Where $where)
{
$where->whereBetween('c1', $param1, $param2)
->whereBetween('c2', $param3, $param4);
});
// SELECT ... WHERE (c1 BETWEEN ? AND ? AND c2 BETWEEN ? AND ?)$stmt->where(function (Where $where)
{
$where->whereBetween('c1', $param1, $param2)
->orWhereBetween('c2', $param3, $param4);
});
// SELECT ... WHERE (c1 BETWEEN ? AND ? OR c2 BETWEEN ? AND ?)$stmt->where(function (Where $where)
{
$where->whereNotBetween('c1', $param1, $param2)
->orWhereNotBetween('c2', $param3, $param4);
});
// SELECT ... WHERE (NOT c1 BETWEEN ? AND ? OR NOT c2 BETWEEN ? AND ?)$stmt->where(function (Where $where)
{
$where->whereNull('c1')
->whereNull('c2');
});
// SELECT ... WHERE (c1 IS NULL AND c2 IS NULL)$stmt->where(function (Where $where)
{
$where->whereNull('c1')
->orWhereNull('c2');
});
// SELECT ... WHERE (c1 IS NULL OR c2 IS NULL)$stmt->where(function (Where $where)
{
$where->whereNotNull('c1')
->orWhereNotNull('c2');
});
// SELECT ... WHERE (NOT c1 IS NULL OR NOT c2 IS NULL)See Subquery.
$stmt->where(
$connection->select()
->columns('COUNT(*)')
->from('t1'),
0
);
// SELECT ... WHERE (SELECT COUNT(*) FROM t1) = 0$stmt->where('c1', $param1)
->orWhere('c2', $param2);
// SELECT ... WHERE c1 = ? OR c2 = ?
$stmt->whereNot('c1', $param);
// SELECT ... WHERE NOT c1 = ?
$stmt->where('c1', $param1)
->orWhereNot('c2', $param2);
// SELECT ... WHERE c1 = ? OR NOT c2 = ?
$stmt->whereIn('c1', [$param1, $param2]);
// SELECT ... WHERE c1 IN (?, ?)$stmt->where('c1', $param1)
->orWhereIn('c2', [$param2, $param3]);
// SELECT ... WHERE c1 = ? OR c2 IN (?, ?)$stmt->whereNotIn('c1', [$param1, $param2]);
// SELECT ... WHERE NOT c1 IN (?, ?)$stmt->where('c1', $param1)
->orWhereNotIn('c2', [$param2, $param3]);
// SELECT ... WHERE c1 = ? OR NOT c2 IN (?, ?)$stmt->whereBetween('c1', $param1, $param2);
// SELECT ... WHERE c1 BETWEEN ? AND ?
$stmt->where('c1', $param1)
->orWhereBetween('c2', $param2, $param3);
// SELECT ... WHERE c1 = ? OR c2 BETWEEN ? AND ?
$stmt->whereNotBetween('c1', $param1, $param2);
// SELECT ... WHERE NOT c1 BETWEEN ? AND ?
$stmt->where('c1', $param1)
->orWhereNotBetween('c2', $param2, $param3);
// SELECT ... WHERE c1 = ? OR NOT c2 BETWEEN ? AND ?
$stmt->whereNull('c1');
// SELECT ... WHERE c1 IS NULL$stmt->where('c1', $param)
->orWhereNull('c2');
// SELECT ... WHERE c1 = ? OR c2 IS NULL$stmt->whereNotNull('c1');
// SELECT ... WHERE NOT c1 IS NULL$stmt->where('c1', $param)
->orWhereNotNull('c2');
// SELECT ... WHERE c1 = ? OR NOT c2 IS NULL$stmt->groupBy('c1');
// SELECT ... GROUP BY c1$stmt->groupBy('c1', 'c2');
// SELECT ... GROUP BY c1, c2$stmt->groupBy(['c1', 'c2']);
// SELECT ... GROUP BY c1, c2MariaDB and MySQL only.
$stmt->groupBy('c1')->withRollup();
// SELECT ... GROUP BY c1 WITH ROLLUP$stmt->having('c1', $param);
// SELECT ... HAVING c1 = ?
$stmt->having('c1', '!=', $param);
// SELECT ... HAVING c1 != ?
$stmt->having([
'c1' => $param1,
'c2' => $param2,
]);
// SELECT ... HAVING (c1 = ? AND c2 = ?)$stmt->having('c1', new Raw('c2'));
// SELECT ... HAVING c1 = c2use MichaelRushton\Database\SQL\Components\Having;
$stmt->having(function (Having $having)
{
$having->having('c1', $param1)
->having('c2', $param2);
});
// SELECT ... HAVING (c1 = ? AND c2 = ?)$stmt->having(function (Having $having)
{
$having->having('c1', $param1)
->orHaving('c2', $param2);
});
// SELECT ... HAVING (c1 = ? OR c2 = ?)$stmt->having(function (Having $having)
{
$having->havingNot('c1', $param1)
->orHavingNot('c2', $param2);
});
// SELECT ... HAVING (NOT c1 = ? OR NOT c2 = ?)$stmt->having(function (Having $having)
{
$having->havingIn('c1', [$param1, $param2])
->havingIn('c2', [$param3, $param4]);
});
// SELECT ... HAVING (c1 IN (?, ?) AND c2 IN (?, ?))$stmt->having(function (Having $having)
{
$having->havingIn('c1', [$param1, $param2])
->orHavingIn('c2', [$param3, $param4]);
});
// SELECT ... HAVING (c1 IN (?, ?) OR c2 IN (?, ?))$stmt->having(function (Having $having)
{
$having->havingNotIn('c1', [$param1, $param2])
->orHavingNotIn('c2', [$param3, $param4]);
});
// SELECT ... HAVING (NOT c1 IN (?, ?) OR NOT c2 IN (?, ?))$stmt->having(function (Having $having)
{
$having->havingBetween('c1', $param1, $param2)
->havingBetween('c2', $param3, $param4);
});
// SELECT ... HAVING (c1 BETWEEN ? AND ? AND c2 BETWEEN ? AND ?)$stmt->having(function (Having $having)
{
$having->havingBetween('c1', $param1, $param2)
->orHavingBetween('c2', $param3, $param4);
});
// SELECT ... HAVING (c1 BETWEEN ? AND ? OR c2 BETWEEN ? AND ?)$stmt->having(function (Having $having)
{
$having->havingNotBetween('c1', $param1, $param2)
->orHavingNotBetween('c2', $param3, $param4);
});
// SELECT ... HAVING (NOT c1 BETWEEN ? AND ? OR NOT c2 BETWEEN ? AND ?)$stmt->having(function (Having $having)
{
$having->havingNull('c1')
->havingNull('c2');
});
// SELECT ... HAVING (c1 IS NULL AND c2 IS NULL)$stmt->having(function (Having $having)
{
$having->havingNull('c1')
->orHavingNull('c2');
});
// SELECT ... HAVING (c1 IS NULL OR c2 IS NULL)$stmt->having(function (Having $having)
{
$having->havingNotNull('c1')
->orHavingNotNull('c2');
});
// SELECT ... HAVING (NOT c1 IS NULL OR NOT c2 IS NULL)See Subquery.
$stmt->having(
$connection->select()
->columns('COUNT(*)')
->from('t1'),
0
);
// SELECT ... HAVING (SELECT COUNT(*) FROM t1) = 0$stmt->having('c1', $param1)
->orHaving('c2', $param2);
// SELECT ... HAVING c1 = ? OR c2 = ?
$stmt->havingNot('c1', $param);
// SELECT ... HAVING NOT c1 = ?
$stmt->having('c1', $param1)
->orHavingNot('c2', $param2);
// SELECT ... HAVING c1 = ? OR NOT c2 = ?
$stmt->havingIn('c1', [$param1, $param2]);
// SELECT ... HAVING c1 IN (?, ?)$stmt->having('c1', $param1)
->orHavingIn('c2', [$param2, $param3]);
// SELECT ... HAVING c1 = ? OR c2 IN (?, ?)$stmt->havingNotIn('c1', [$param1, $param2]);
// SELECT ... HAVING NOT c1 IN (?, ?)$stmt->having('c1', $param1)
->orHavingNotIn('c2', [$param2, $param3]);
// SELECT ... HAVING c1 = ? OR NOT c2 IN (?, ?)$stmt->havingBetween('c1', $param1, $param2);
// SELECT ... HAVING c1 BETWEEN ? AND ?
$stmt->having('c1', $param1)
->orHavingBetween('c2', $param2, $param3);
// SELECT ... HAVING c1 = ? OR c2 BETWEEN ? AND ?
$stmt->havingNotBetween('c1', $param1, $param2);
// SELECT ... HAVING NOT c1 BETWEEN ? AND ?
$stmt->having('c1', $param1)
->orHavingNotBetween('c2', $param2, $param3);
// SELECT ... HAVING c1 = ? OR NOT c2 BETWEEN ? AND ?
$stmt->havingNull('c1');
// SELECT ... HAVING c1 IS NULL$stmt->having('c1', $param)
->orHavingNull('c2');
// SELECT ... HAVING c1 = ? OR c2 IS NULL$stmt->havingNotNull('c1');
// SELECT ... HAVING NOT c1 IS NULL$stmt->having('c1', $param)
->orHavingNotNull('c2');
// SELECT ... HAVING c1 = ? OR NOT c2 IS NULL$stmt->orderBy('c1');
// SELECT ... ORDER BY c1$stmt->orderBy('c1', 'c2');
// SELECT ... ORDER BY c1, c2$stmt->orderBy(['c1', 'c2']);
// SELECT ... ORDER BY c1, c2$stmt->orderByDesc('c1');
// SELECT ... ORDER BY c1 DESCPostgreSQL and SQLite only.
$stmt->orderByNullsFirst('c1');
// SELECT ... ORDER BY c1 ASC NULLS FIRSTPostgreSQL and SQLite only.
$stmt->orderByNullsLast('c1');
// SELECT ... ORDER BY c1 ASC NULLS LASTPostgreSQL and SQLite only.
$stmt->orderByDescNullsFirst('c1');
// SELECT ... ORDER BY c1 DESC NULLS FIRSTPostgreSQL and SQLite only.
$stmt->orderByDescNullsLast('c1');
// SELECT ... ORDER BY c1 DESC NULLS LASTMariaDB, MySQL, PostgreSQL and SQLite only.
$stmt->limit(10);
// SELECT ... LIMIT 10$stmt->limit(10, 5);
// SELECT ... LIMIT 10 OFFSET 5MariaDB only.
$stmt->limit(10)->rowsExamined(100);
// SELECT ... LIMIT 10 ROWS EXAMINED 100MariaDB, PostgreSQL and SQLServer only.
$stmt->offsetFetch(5, 10);
// SELECT ... OFFSET 5 ROWS FETCH NEXT 10 ROWS ONLY$stmt->offsetFetch(5, 10)->withTies();
// SELECT ... OFFSET 5 ROWS FETCH NEXT 10 ROWS WITH TIES$stmt->union(function ($select)
{
$select->from('t1');
});
// SELECT ... UNION SELECT * FROM t1$stmt->unionAll(function ($select)
{
$select->from('t1');
});
// SELECT ... UNION ALL SELECT * FROM t1$stmt->intersect(function ($select)
{
$select->from('t1');
});
// SELECT ... INTERSECT SELECT * FROM t1MariaDB, MySQL, and PostgreSQL only.
$stmt->intersectAll(function ($select)
{
$select->from('t1');
});
// SELECT ... INTERSECT ALL SELECT * FROM t1$stmt->except(function ($select)
{
$select->from('t1');
});
// SELECT ... EXCEPT SELECT * FROM t1MariaDB, MySQL, and PostgreSQL only.
$stmt->exceptAll(function ($select)
{
$select->from('t1');
});
// SELECT ... EXCEPT ALL SELECT * FROM t1MySQL, PostgreSQL, SQLite, and SQLServer only.
See Window.
$stmt->window('w1', function (Window $window)
{
});
// SELECT ... WINDOW w1 AS ()See CTE.
use MichaelRushton\Database\SQL\Components\CTE;
$stmt->cte(
'cte1',
function ($select)
{
$select->from('t1');
},
function (CTE $cte)
{
}
);
// WITH cte1 AS (SELECT * FROM t1) SELECTuse MichaelRushton\Database\SQL\Components\CTE;
$stmt->cte('cte1', 'SELECT * FROM t1')->recursive();
// WITH RECURSIVE cte1 AS (SELECT * FROM t1) SELECTMariaDB and MySQL only.
$stmt->highPriority();
// SELECT HIGH_PRIORITYMariaDB and MySQL only.
$stmt->straightJoinAll();
// SELECT STRAIGHT_JOINMariaDB and MySQL only.
$stmt->sqlSmallResult();
// SELECT SQL_SMALL_RESULTMariaDB and MySQL only.
$stmt->sqlBigResult();
// SELECT SQL_BIG_RESULTMariaDB and MySQL only.
$stmt->sqlBufferResult();
// SELECT SQL_BUFFER_RESULTMariaDB only.
$stmt->sqlCache();
// SELECT SQL_CACHEMariaDB only.
$stmt->sqlNoCache();
// SELECT SQL_NO_CACHEMariaDB and MySQL only.
$stmt->sqlCalcFoundRows();
// SELECT SQL_CALC_FOUND_ROWSMariaDB and MySQL only.
See Outfile.
use MichaelRushton\Database\SQL\Components\Outfile;
$stmt->intoOutfile('/path/to/file', function (Outfile $outfile)
{
});
// SELECT ... INTO OUTFILE '/path/to/file'MariaDB and MySQL only.
$stmt->intoDumpfile('/path/to/file');
// SELECT ... INTO DUMPFILE '/path/to/file'MariaDB and MySQL only.
$stmt->intoVar('v1');
// SELECT ... INTO @v1$stmt->intoVar('v1', 'v2');
// SELECT ... INTO @v1, @v2$stmt->intoVar(['v1', 'v2']);
// SELECT ... INTO @v1, @v2SQLServer only.
$stmt->into('t2');
// SELECT ... INTO t2MariaDB, MySQL, and PostgreSQL only.
$stmt->forUpdate();
// SELECT ... FOR UPDATEMySQL and PostgreSQL only.
$stmt->forUpdate('t1');
// SELECT ... FOR UPDATE OF t1MySQL and PostgreSQL only.
$stmt->forUpdate('t1', 't2');
// SELECT ... FOR UPDATE OF t1, t2MySQL and PostgreSQL only.
$stmt->forUpdate(['t1', 't2']);
// SELECT ... FOR UPDATE OF t1, t2MariaDB only.
$stmt->forUpdateWait(5);
// SELECT ... FOR UPDATE WAIT 5MariaDB, MySQL and PostgreSQL only.
$stmt->forUpdateNoWait();
// SELECT ... FOR UPDATE NOWAITMySQL and PostgreSQL only.
$stmt->forUpdateNoWait('t1');
// SELECT ... FOR UPDATE OF t1 NOWAITMySQL and PostgreSQL only.
$stmt->forUpdateNoWait('t1', 't2');
// SELECT ... FOR UPDATE OF t1, t2 NOWAITMySQL and PostgreSQL only.
$stmt->forUpdateNoWait(['t1', 't2']);
// SELECT ... FOR UPDATE OF t1, t2 NOWAITMariaDB, MySQL and PostgreSQL only.
$stmt->forUpdateSkipLocked();
// SELECT ... FOR UPDATE SKIP LOCKEDMySQL and PostgreSQL only.
$stmt->forUpdateSkipLocked('t1');
// SELECT ... FOR UPDATE OF t1 SKIP LOCKEDMySQL and PostgreSQL only.
$stmt->forUpdateSkipLocked('t1', 't2');
// SELECT ... FOR UPDATE OF t1, t2 SKIP LOCKEDMySQL and PostgreSQL only.
$stmt->forUpdateSkipLocked(['t1', 't2']);
// SELECT ... FOR UPDATE OF t1, t2 SKIP LOCKEDPostgreSQL only.
$stmt->forNoKeyUpdate();
// SELECT ... FOR NO KEY UPDATE$stmt->forNoKeyUpdate('t1');
// SELECT ... FOR NO KEY UPDATE OF t1$stmt->forNoKeyUpdate('t1', 't2');
// SELECT ... FOR NO KEY UPDATE OF t1, t2$stmt->forNoKeyUpdate(['t1', 't2']);
// SELECT ... FOR NO KEY UPDATE OF t1, t2PostgreSQL only.
$stmt->forNoKeyUpdateNoWait();
// SELECT ... FOR NO KEY UPDATE NOWAIT$stmt->forNoKeyUpdateNoWait('t1');
// SELECT ... FOR NO KEY UPDATE OF t1 NOWAIT$stmt->forNoKeyUpdateNoWait('t1', 't2');
// SELECT ... FOR NO KEY UPDATE OF t1, t2 NOWAIT$stmt->forNoKeyUpdateNoWait(['t1', 't2']);
// SELECT ... FOR NO KEY UPDATE OF t1, t2 NOWAITPostgreSQL only.
$stmt->forNoKeyUpdateSkipLocked();
// SELECT ... FOR NO KEY UPDATE SKIP LOCKED$stmt->forNoKeyUpdateSkipLocked('t1');
// SELECT ... FOR NO KEY UPDATE OF t1 SKIP LOCKED$stmt->forNoKeyUpdateSkipLocked('t1', 't2');
// SELECT ... FOR NO KEY UPDATE OF t1, t2 SKIP LOCKED$stmt->forNoKeyUpdateSkipLocked(['t1', 't2']);
// SELECT ... FOR NO KEY UPDATE OF t1, t2 SKIP LOCKEDMySQL and PostgreSQL only.
$stmt->forShare();
// SELECT ... FOR SHARE$stmt->forShare('t1');
// SELECT ... FOR SHARE OF t1$stmt->forShare('t1', 't2');
// SELECT ... FOR SHARE OF t1, t2$stmt->forShare(['t1', 't2']);
// SELECT ... FOR SHARE OF t1, t2MySQL and PostgreSQL only.
$stmt->forShareNoWait();
// SELECT ... FOR SHARE NOWAIT$stmt->forShareNoWait('t1');
// SELECT ... FOR SHARE OF t1 NOWAIT$stmt->forShareNoWait('t1', 't2');
// SELECT ... FOR SHARE OF t1, t2 NOWAIT$stmt->forShareNoWait(['t1', 't2']);
// SELECT ... FOR SHARE OF t1, t2 NOWAITMySQL and PostgreSQL only.
$stmt->forShareSkipLocked();
// SELECT ... FOR SHARE SKIP LOCKED$stmt->forShareSkipLocked('t1');
// SELECT ... FOR SHARE OF t1 SKIP LOCKED$stmt->forShareSkipLocked('t1', 't2');
// SELECT ... FOR SHARE OF t1, t2 SKIP LOCKED$stmt->forShareSkipLocked(['t1', 't2']);
// SELECT ... FOR SHARE OF t1, t2 SKIP LOCKEDPostgreSQL only.
$stmt->forKeyShare();
// SELECT ... FOR KEY SHARE$stmt->forKeyShare('t1');
// SELECT ... FOR KEY SHARE OF t1$stmt->forKeyShare('t1', 't2');
// SELECT ... FOR KEY SHARE OF t1, t2$stmt->forKeyShare(['t1', 't2']);
// SELECT ... FOR KEY SHARE OF t1, t2PostgreSQL only.
$stmt->forKeyShareNoWait();
// SELECT ... FOR KEY SHARE NOWAIT$stmt->forKeyShareNoWait('t1');
// SELECT ... FOR KEY SHARE OF t1 NOWAIT$stmt->forKeyShareNoWait('t1', 't2');
// SELECT ... FOR KEY SHARE OF t1, t2 NOWAIT$stmt->forKeyShareNoWait(['t1', 't2']);
// SELECT ... FOR KEY SHARE OF t1, t2 NOWAITPostgreSQL only.
$stmt->forKeyShareSkipLocked();
// SELECT ... FOR KEY SHARE SKIP LOCKED$stmt->forKeyShareSkipLocked('t1');
// SELECT ... FOR KEY SHARE OF t1 SKIP LOCKED$stmt->forKeyShareSkipLocked('t1', 't2');
// SELECT ... FOR KEY SHARE OF t1, t2 SKIP LOCKED$stmt->forKeyShareSkipLocked(['t1', 't2']);
// SELECT ... FOR KEY SHARE OF t1, t2 SKIP LOCKEDMariaDB and MySQL only.
$stmt->lockInShareMode();
// SELECT ... LOCK IN SHARE MODEMariaDB only.
$stmt->lockInShareModeWait(5);
// SELECT ... LOCK IN SHARE MODE WAIT 5MariaDB only.
$stmt->lockInShareModeNoWait();
// SELECT ... LOCK IN SHARE MODE NOWAITMariaDB only.
$stmt->lockInShareModeSkipLocked();
// SELECT ... LOCK IN SHARE MODE SKIP LOCKED