sql增删改查

sql增删改查
一、插入语句
insert into [table] ([column],[column],[column])
values(?,?,?)
二、删除语句
delete
from [table]
where column = ?
三、修改语句
update [table]
set column = ?
where column = ?
四、查询语句
1)查询单条记录的所有字段
select *
from [table]
where [column] = ?
2)查询所有记录的所有字段
select *
from [table]
order by [column] asc

注意!!!
1.order by column asc代表:以column字段,升序排列。desc为降序
3)查询给定偏移量的记录的所有字段
select *
from [table]
limit [offset], [limit]

注意!!!
1.offset指定从哪个索引开始,默认从0开始
2.limit指定查询几条记录
4)查询指定记录的指定字段
select [column], [column]
form [table]
where [column] = ?

posted @ 2020-11-12 13:50  RanXingshuo  阅读(108)  评论(0编辑  收藏  举报