简单查询问题送分来了哦!!!!

yoskool 2008-03-18 06:28:29
1
字段ID 姓名 科目 分数
1 A 语文 80
2 A 数学 90
3 B 语文 90
4 B 数学 90
5 C 语文 90
5 C 数学 80
找出分数都是90分的同学姓名


2 表
ID 类别 价钱 点击
1 男装 120 2
2 女装 110 9
3 女裤 220 8
4 男裤 300 5
5 女鞋 800 9
6 男鞋 700 2

查询出同类别服装(男女为同类)按点击次数排序
...全文
207 38 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
38 条回复
切换为时间正序
请发表友善的回复…
发表回复
ma3qiang2 2008-03-20
  • 打赏
  • 举报
回复
接分而来
viva369 2008-03-20
  • 打赏
  • 举报
回复
抢分啊
w2jc 2008-03-20
  • 打赏
  • 举报
回复
接分啦,上面都答完了
zhuyx808 2008-03-20
  • 打赏
  • 举报
回复
[Quote=引用 27 楼 wwh999 的回复:]
各位的猜测能力真是....!~@$@(($@,...暴强...

LZ贴声放分...各种类型的回复都给臆想出来了...牛X,都当水贴好欺啊...~0~
[/Quote]

印钞机(1毛/秒)...发狂中...不够纸钱


帮我印几ww张百元钞吧
wzjpsq 2008-03-20
  • 打赏
  • 举报
回复
问题太简单, 只能纯接分了
wwh999 2008-03-20
  • 打赏
  • 举报
回复
各位的猜测能力真是....!~@$@(($@,...暴强...

LZ贴声放分...各种类型的回复都给臆想出来了...牛X,都当水贴好欺啊...~0~
想飞的狼 2008-03-20
  • 打赏
  • 举报
回复
哈哈,给分
山之魂2 2008-03-20
  • 打赏
  • 举报
回复
[Quote=引用 13 楼 JiangHongTao 的回复:]
送分题,你们也要答对才行呀:
1、

 select distinct 姓名 from tb  a where not exists(select 1 from tb where 姓名 = a.姓名 and 分数<> 90)


2、

select right(rtrim(类别),len(rtrim(类别))-1),sum(点击) from tb
group byright(rtrim(类别) order by sum(点击)

[/Quote]

顶我的本家,
其余的那些水枪就不要来丢丑了哦
chongxiaoyihe 2008-03-20
  • 打赏
  • 举报
回复
恩,学习中....各位大大好语句
wuzhj3107 2008-03-20
  • 打赏
  • 举报
回复
--呵呵,刚第二句忘记排序了。排序如下:
select 类别,sum(点击)as'点击'from 2
group by 类别
order by '点击'
wuzhj3107 2008-03-20
  • 打赏
  • 举报
回复
1、
select 姓名,count(分数) from 1
where 分数='90'
group by 姓名
having count(分数)>1

2、
select 类别,sum(点击)from 2
group by 类别


--哈哈,给点意见啊。我还是菜鸟。
heshengfen123 2008-03-20
  • 打赏
  • 举报
回复
来接接分
zhuyx808 2008-03-19
  • 打赏
  • 举报
回复
接分接分
haojieguangxin 2008-03-19
  • 打赏
  • 举报
回复
1.
select distinct name from table1
group by name
having min(grade)=90
abs44544 2008-03-19
  • 打赏
  • 举报
回复

是不是..男裤和女裤是一类...鞋也是....
select distinct name from 表1 where 分数 = 90

select * from 表2 order by right(类别,1),点击
sniper0221 2008-03-19
  • 打赏
  • 举报
回复
没难度啊! 接分啦
AAAlove 2008-03-19
  • 打赏
  • 举报
回复
1
字段ID 姓名 科目 分数
1 A 语文 80
2 A 数学 90
3 B 语文 90
4 B 数学 90
5 C 语文 90
5 C 数学 80
找出分数都是90分的同学姓名

select name 姓名 from stuinfo where exam=90


2 表
ID 类别 价钱 点击
1 男装 120 2
2 女装 110 9
3 女裤 220 8
4 男裤 300 5
5 女鞋 800 9
6 男鞋 700 2

查询出同类别服装(男女为同类)按点击次数排序

select
type 类别 from product order by click desc --降序
xingchenbbs 2008-03-19
  • 打赏
  • 举报
回复
星辰技术社区:www.netcsharp.cn,我们将帮您以最快的速度找到最佳的解决方案
cxmcxm 2008-03-18
  • 打赏
  • 举报
回复
--1.假设每个同学的每科成绩都已录入
select distinct 姓名 from 表 a where not exists(select * from 表 where 姓名=a.姓名 and 分数<>90)

--2.
select * from 表 order by stuff(类别,1,1,''),点击 desc
Limpire 2008-03-18
  • 打赏
  • 举报
回复
--> 测试数据: #1
if object_id('tempdb.dbo.#1') is not null drop table #1
create table #1 (ID int,姓名 varchar(1),科目 varchar(4),分数 int)
insert into #1
select 1,'A','语文',80 union all
select 2,'A','数学',90 union all
select 3,'B','语文',90 union all
select 4,'B','数学',90 union all
select 5,'C','语文',90 union all
select 6,'C','数学',80
--> 测试数据: #2
if object_id('tempdb.dbo.#2') is not null drop table #2
create table #2 (ID int,类别 varchar(4),价钱 int,点击 int)
insert into #2
select 1,'男装',120,2 union all
select 2,'女装',110,9 union all
select 3,'女裤',220,8 union all
select 4,'男裤',300,5 union all
select 5,'女鞋',800,9 union all
select 6,'男鞋',700,2

--> 找出分数都是90分的同学姓名:
select 姓名 from #1 t where not exists (select 1 from #1 where 姓名=t.姓名 and 分数<>90) group by 姓名 having count(1) = 2

--> 查询出同类别服装(男女为同类)按点击次数排序:
--> 这个问题描述不明确,我觉得楼主应该是要1男1女这样排,这就有点难搞,先抄上面的答案。
select * from #2 order by left(类别,1),点击 desc
加载更多回复(18)

34,838

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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