选择除顶行以外的所有行 [英] select all rows except top row
本文介绍了选择除顶行以外的所有行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从表中返回除第一行之外的所有行.这是我的sql语句:
how do I return all rows from a table except the first row. Here is my sql statement:
Select Top(@TopWhat) *
from tbl_SongsPlayed
where Station = @Station
order by DateTimePlayed DESC
如何修改我的 SQL 语句以返回除第一行之外的所有行.
How do I alter my SQL statement to return all rows except the first row.
非常感谢
推荐答案
SQL 2012 也有相当方便的 OFFSET 子句:
SQL 2012 also has the rather handy OFFSET clause:
Select Top(@TopWhat) *
from tbl_SongsPlayed
where Station = @Station
order by DateTimePlayed DESC
OFFSET 1 ROWS
这篇关于选择除顶行以外的所有行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文