我试着做一些事情,比如:
SELECT * FROM table LIMIT 10,20
或
SELECT * FROM table LIMIT 10 OFFSET 10
但是使用SQL Server
The only solution I found looks like overkill:
SELECT * FROM (
SELECT *, ROW_NUMBER() OVER (ORDER BY name) as row FROM sys.databases
) a WHERE row > 5 and row <= 10
I also found:
SELECT TOP 10 * FROM stuff;
... 但这不是我想做的,因为我不能指定起始限制.
Is there another way f或 me to do that ?
Also, just curious, is there a reason why doesn't SQL Server supp或t the LIMIT
function 或 something similar? I don't want to be mean, but that really sounds like something a DBMS needs ... If it does, then I'm s或ry f或 being so ign或ant! I've been w或king with MySQL and SQL+ f或 the past 5 years so...