我不知道应该用什么标题,是sql语句的问题
select top 2 * from Unit where cid = '100110001000'
union
select top 2 * from Unit where cid = '100110001001'
union
select top 2 * from Unit where cid = '100110001002'
union
select top 2 * from Unit where cid = '100110001003'
大概的意思由上述的语句表达出来了,字段cid在unit表中,就是要在表unit中只选择每个相同cid的前两条记录,但是上述语句无法应对cid变化的情况,我不知道能不能用一个sql语句或者是存储过程写出来,谢谢各位!!!!