日期:2014-05-17 浏览次数:20757 次
SELECT * FROM ( SELECT rid=ROW_NUMBER() OVER(PARTITION BY type ORDER BY name),* FROM ( SELECT * FROM T ) X ) AS T WHERE rid<=10
SELECT * FROM (SELECT t.*,ROW_NUMBER() OVER(PARTITION BY type ORDER BY name) rid FROM T ) WHERE rid<=10