入门级select 求助

redlei 2011-03-14 03:15:40
有一个表: 表1,结构如下
内容1 内容2
1111 kdka
1132 sdkfjal
0099 fajdsl
1111 kjlkk
0099 lkfds


经过select 语句检索 以后,我想返回
内容1
1111
1132
0099

就是 去除那些 重名的,应该怎么做呢?
select 内容1 from 表1 然后呢?
...全文
61 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
Joop_Song 2011-03-14
  • 打赏
  • 举报
回复
select distinct 内容1 from 表1
select * from 表1 group by 内容1


distinct:过滤重复字段。。。
bayysys 2011-03-14
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 chengjia2284 的回复:]
select distinct 内容1 from 表1

select 内容1 from 表1 group by 内容1

这两个好像都可以,你试试
[/Quote]
+1
chengjia2284 2011-03-14
  • 打赏
  • 举报
回复
select distinct 内容1 from 表1

select 内容1 from 表1 group by 内容1

这两个好像都可以,你试试
yutian_31 2011-03-14
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 linuxjava01 的回复:]
select distinct 内容1 from 表1

关键字distinct就是用来筛选重复列的。
[/Quote]
+1
linuxjava01 2011-03-14
  • 打赏
  • 举报
回复
select distinct 内容1 from 表1

关键字distinct就是用来筛选重复列的。
贪玩的老鼠 2011-03-14
  • 打赏
  • 举报
回复
select distinct 内容1 from 表1

select 内容1 from 表1 group by 内容1
jeje 2011-03-14
  • 打赏
  • 举报
回复
select distinct 内容1 from 表1
select * from 表1 group by 内容1
你试一下不知道行不.我机上没有SQL没有测试的
zilong4460072 2011-03-14
  • 打赏
  • 举报
回复
select distinct 内容1 from 表1
友林 2011-03-14
  • 打赏
  • 举报
回复
select distinct 内容1 from 表1

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧