标签:
SELECT TOP 5 * FROM hos_house WHERE HMID NOT IN(
SELECT TOP 5 HMID FROM hos_house WHERE PRICE>2500 ORDER BY PRICE
) AND PRICE>2500 ORDER BY PRICE
-----注释:只对sqlsever2005版本以上的支持---
SELECT * FROM (
SELECT *, row_no = ROW_NUMBER() OVER(ORDER BY PRICE)
FROM hos_house
WHERE PRICE>2500
) a
WHERE row_no BETWEEN 6 AND 10
标签:
原文地址:http://www.cnblogs.com/Allen974103107/p/5046930.html