我是SQL Server 2008 R2的新手,遇到以下情况。 我正在尝试使用内部联接和addi限制以及相同的偏移来连接两个表。
由于MySQL的语法与SQL Server的语法不同,我无法得到结果。我使用this链接,但它没有以任何方式帮助我。 任何帮助,将不胜感激。谢谢!
答案 0 :(得分:2)
您可以使用此查询:
SET ROWCOUNT x -- x is Rows Count to get For Example : 50
SELECT t.*
FROM (
SELECT row_number() over (ORDER BY a.id ) AS rowindex, a.*
FROM table_1 a INNER JOIN table_2 b ON a.id = b.aid
WHERE -- limit conditions For Example : A.title = 'name2'
) AS t
WHERE t.rowindex >= y -- Y is Start index for Offset
祝你好运