标签:cond zha 取数 HERE oob use 数据库 key 模糊
数据库
增加:
INSERT INTO table_name(key,key1,key2) VALUES(value,value1,value2)
删除:
DELETE FROM table_name WHERE condition;
修改:
UPDATE table_name SET field1=newvalue, field2=newvalue WHERE runoob_id=3;
查询:
SELECT * FROM table_name WHERE 参数
示例:SELECT * FROM table_name WHERE username=‘zhangsan‘ AND pwd=‘12‘
**高级用法**
联合查询:
SELECT b.*, u.username FROM borrowmoney b JOIN user u ON b.userid=u.id
分页查询:
SELECT * FROM table_name LIMIT 5,10; // 检索指定记录,从索引5开始,找到10条数据
获取数据条数:
SELECT COUNT(*) FROM table_name
模糊查询
WHERE category=4 AND name LIKE ‘%白%‘
-- DELETE FROM user WHERE id=21
-- 1页 3条数据 0, 3 page row
-- 2页 3条数据 3, 3
-- 3页 3条数据 6, 3
SELECT * FROM user LIMIT (page - 1) * row, row
标签:cond zha 取数 HERE oob use 数据库 key 模糊
原文地址:https://www.cnblogs.com/minister/p/11218134.html