## `where`
此方法用于指定AND查询条件
## 示例:
~~~
where = {
'id': 1,
'name': 'test'
}
db.name('user').where(where).select()
~~~
~~~
where = [
['id', '>', 1],
['name', 'like', '%test%']
]
db.name('user').where(where).select()
~~~
~~~
db.name('user').where("id > 1 and name = 'test'").select()
~~~
~~~
db.name('user').where('id', 1).select()
~~~
~~~
db.name('user').where('name', 'test').select()
~~~
~~~
db.name('user').where('name', 'like', '%test%').select()
~~~
~~~
db.name('user').where('name', 'like', ['test1', 'test2']).select()
~~~
~~~
db.name('user').where('name', 'not like', '%test%').select()
~~~
~~~
db.name('user').where('name', 'not like', ['test1', 'test2']).select()
~~~
~~~
db.name('user').where('id', 'between', [1, 5]).select()
~~~
~~~
db.name('user').where('id', 'not between', [1, 5]).select()
~~~
~~~
db.name('user').where('id', 'in', [1, 2]).select()
~~~
~~~
db.name('user').where('id', 'not in', [1, 2]).select()
~~~
>[danger] WHERE支持MYSQL所有表达式,包括like、not like、between、not between、 in、not in等
- 连接数据库
- 链式操作方法
- distinct
- field
- withoutField
- name
- alias
- force
- join
- leftJoin
- rightJoin
- union
- unionAll
- where
- whereOr
- whereTime
- whereBetweenTime
- whereNotBetweenTime
- whereBetweenTimeField
- whereNotBetweenTimeField
- whereYear
- whereMonth
- whereWeek
- whereDay
- group
- having
- order
- orderRand
- limit
- page
- lock
- comment
- ignore
- inc
- dec
- fetchSql
- 查询数据
- 聚合查询
- 新增数据
- 更新数据
- 删除数据
- 原生操作