各位大侠,请教一个问题 现在有个表: 字段A, 字段B T1 a T2 a T3 a T4 b T5 b T6 b T7 c T8 c T9 c 希望查询的结果为: T1 a T4 b T7 c谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select 字段A, 字段Bfrom 表where 字段A in(select min(字段A) from 表 group by 字段B) select * from t t1 where A = (select min(A) from t t2 where t1.B= t2.B) select * from t t1 where not exists(select 1 from t t2 where t1.B = t2.B and t1.A > t2.A) select min(a) a,bfrom tbgroup by b select 字段A, 字段Bfrom 表 t where not exists(select 1 from 表 where 字段B = t.字段B and 字段A > t.字段A) select 字段A, 字段Bfrom 表 twhere 字段A =(select min(字段A) from 表 字段B=t.字段B) select distinct (select top 1 字段A from 表 where 字段B=a.字段B) as 字段A,字段B from 表 a 求SQL查找语句 如何得到我要的答案 请教大家一个问题。。。。 详见说明 关于腾讯qq的一个设计问题 UNPIVOT 分组问题 关于连接sql2000报sql2005的错误 怎样上传播放器 表遍历查询 sql 问题 sql2008关于"openrowset"的使用 求SQL Server考试70-450资料
select 字段A, 字段B
from 表
where 字段A in(select min(字段A) from 表 group by 字段B)
select min(a) a,b
from tb
group by b
from 表 t
where not exists(select 1 from 表 where 字段B = t.字段B and 字段A > t.字段A)
字段A, 字段B
from
表 t
where
字段A =(select min(字段A) from 表 字段B=t.字段B)