mssql根据分类查询每个分类前100条数据 表名m_data,分类字段名m_type

SELECT *
FROM(    SELECT    ROW_NUMBER()OVER(PARTITION BY m_type order by m_id) AS Num,*
    FROM    m_data) as temp
WHERE Num <= 100

posted @ 2012-12-20 10:36  qisheng722  阅读(485)  评论(0编辑  收藏  举报