查询:
select *from users where id=1
select `id` from users
插入数据:
insert into users value(null,'CEO','码子','18')
insert into users values(null,'CEO','码子','18')
insert into users(name,title,age,gender) value ('CEO','码子',18,0)
配合数据筛选
delete from users where title='ufo' and id=1
delete from users where title='ufo' or id=1
delete from users where id in (1,2,3,4)
修改:
update users set title='CEO',`name`='张三' where id=1
查询函数:
select count(id) from users //count 分页功能,查询总页数
select count(1) from users //查询具体值
select count(1) as count from users;
select max(id) from users
select min(id) from users
select avg(id) from users
select * from users limit 2 //只取两条
select * from users limit 0,2 //越过0条取2条
skip=(page-1)*size //分页越过skip条