select Distinct Mobile ,mesdst from TB_Mobile 上面是 我查询的 重复的数据 只显示一次 但是 我希望查询出整个表的信息。然后重复的数据只显示一次。
解决方案 »
- 哪个高人介绍一下手机短信编程相关信息
- 页面刷新问题
- 有关 menuvb (戏子……流浪于VS~) 发布的论坛的问题——我如何看到源码?
- $¥$¥$¥$¥$¥$¥$¥$¥$¥$¥$¥$¥$¥$¥$¥$¥$¥各位大侠目前asp.net程序员工资大概是多少?
- 模扳列修改操作的疑问 :)~~~
- 有个文学网站想找人写后台,要求有大流量处理经验^^
- 一个关于Html格式的问题(没有分了)
- 如何获得datalist控件中某一项数据的内容?
- HTTP500后 取消勾选“友好http信息错误”能正常访问
- 指定DataSource老是报错,不知道错在什么地方
- 【随机抽取数组】
- .NET访问HTTPS网站并进行登录,怎么做?
declare @TB_Mobile table (id int,Mobile int,mesdst int,other varchar(1))
insert into @TB_Mobile
select 1,139139,77,'a' union all
select 2,139139,77,'b' union all
select 3,139139,77,'c' union all
select 4,139132,77,'d' union all
select 5,139132,77,'e' union all
select 6,139133,77,'f' union all
select 7,139134,77,'g' union all
select 8,139134,77,'h'select * from @TB_Mobile a
where id=(select min(id) from @TB_Mobile
where Mobile=a.Mobile and mesdst=a.mesdst)
order by id
/*
id Mobile mesdst other
----------- ----------- ----------- -----
1 139139 77 a
4 139132 77 d
6 139133 77 f
7 139134 77 g
*/
insert into #temp
select 1,'11','a' union all
select 2,'11','b' union all
select 3,'22','a' union all
select 4,'22','b' union all
select 5,'22','c' union all
select 6,'33','a' union all
select 7,'33','b' union allselect * from #tempselect * from #temp t where id=(select min(id) from #temp where t.Mobile=Mobile)
select * from TB_Mobile where id in (
select mind(id) from TB_Mobile group by Mobile
)