core
db
html
utility
SqlAbstract::whereNotIn
public SqlAbstract whereNotIn
( string $column, array $values )
IN演算子による否定の条件の指定を行います。
whereInの否定条件版です。
第二引数に複数の値を配列で指定することにより、すべての値のどれにも合致しない条件を指定することができます。
$ages = array(20, 21, 22, 23, 24, 25);
$select->where('name', 'taro');
$select->whereNotIn('age', $ages);
→WHERE (name = 'taro') AND (age NOT IN (20, 21, 22, 23, 24, 25))
whereInの否定条件版です。
第二引数に複数の値を配列で指定することにより、すべての値のどれにも合致しない条件を指定することができます。
$ages = array(20, 21, 22, 23, 24, 25);
$select->where('name', 'taro');
$select->whereNotIn('age', $ages);
→WHERE (name = 'taro') AND (age NOT IN (20, 21, 22, 23, 24, 25))
パラメーター
| 名前 | 型 | 内容 |
|---|---|---|
| $column | string | 条件比較対象の列名を指定します。 |
| $values | array | 第一引数で指定した列に対する複数の値を配列で指定します。 |
返り値
自分自身のインスタンスを返します。