日期:2014-05-17  浏览次数:21038 次

如何读出给定的几个类别下的新闻?
现在有分类
1,2,3,4,5
数据都在一张表里,怎么把这些分类的前10条数据读取出来?

------解决方案--------------------
sql= "select top 10 * from 表 where 类别=1 union select top 10 * from 表 where 类别=2 union select top 10 * from 表 where 类别=3 union select top 10 * from 表 where 类别=4 union select top 10 * from 表 where 类别=5 "