sql常用语法大全

新增语句 INSERT INTO [table] ([column],[column],[column]) VALUES(?,?,?) 删除语句 DELETE FROM [table] WHERE [column] = ? DELETE FROM vod WHERE id= 1 修改语句 UPDATE [table] SET [column] = ? WHERE [column] = ? 查询语句 查询单条记录的所有字段 SELECT * FROM [table] WHERE [column] = ? 查询所有记录的所有字段 // asc代表:以column字段,升序排列。desc为降序 SELECT * FROM [table] ORDER BY [column] ASC 分页查询 // 1.offset指定从哪个索引开始,默认从0开始 // 2.limit指定查询几条记录 SELECT * FROM [table] LIMIT [offset], [limit] 查询指定记录的指定字段 SELECT [column1], [column2] FROM [table] WHERE [column1] = ?

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wsxpjs.html