sqlservler常用命令

来源:互联网 发布:linux 打开终端快捷键 编辑:程序博客网 时间:2024/06/05 04:07

查看头5条数据

select top 5 * from tb_Log

查看后5条数据

select top 5 * from tb_Log  ORDER BY InsertTime DESC

删除前5条数据

DELETE TOP(5) from tb_Log

删除后5条数据

DELETE  from tb_Log WHERE InsertTime in( select top 5 InsertTime from tb_Log  ORDER BY InsertTime DESC)
原创粉丝点击