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查询出同类别服装(男女为同类)按点击次数排序

解决方案 »

  1.   

    1、
    select distinct name
    from ta
    where 分数 = 90
      

  2.   

    2  表 
    ID   类别   价钱  点击 
    1    男装   120   2 
    2    女装   110   9 
    3    女裤   220   8 
    4    男裤   300   5 
    5    女鞋   800   9 
    6    男鞋   700   2 --select *
    from ta
    order by right(类别,1),点击 desc
      

  3.   

    1
    select distinct Name from A where =90
    2
    select * from B order by 类别,点击
      

  4.   

    --1.
    select distinct Name from A where =90 --2.
    select * from B order by 类别,点击
      

  5.   


    select distinct name from 表1 where 分数 = 90select * from 表2 order by left(类别,1),点击 
      

  6.   

    SELCT 姓名 FROM 表1 WHERE 分数=90
    SELECT * FROM 表2 ORDER BY 点击 题如其名,纯属送分贴
      

  7.   

    PS:  SELCT --> SELECT
      

  8.   

    select distinct name from 表1 where 分数 = 90select * from 表2 order by left(类别,1),点击 
      

  9.   

    create table tb(id int,姓名 varchar(20), 科目 varchar(20),   分数 int)
    insert into tb select 1,'A','语文',80
    insert into tb select 2,'A','数学',90
    insert into tb select 3,'B','语文',90
    insert into tb select 4,'B','数学',90
    insert into tb select 5,'C','语文',90
    insert into tb select 6,'C','数学',80select 姓名 from tb a
    where 分数=90
    group by 姓名
    having count(1)=(select count(1) from tb where 姓名=a.姓名)
    create table ta(id int,类别 varchar(10),价钱 int,点击 int)
    insert into ta select 1,'男装',120,2
    insert into ta select 1,'女装',110,9
    insert into ta select 1,'女裤',220,8
    insert into ta select 1,'男裤',300,5
    insert into ta select 1,'女鞋',800,9
    insert into ta select 1,'男鞋',700,2select * from ta
    order by left(类别,1),点击 1  B
    21 男装 120 2
    1 男鞋 700 2
    1 男裤 300 5
    1 女裤 220 8
    1 女鞋 800 9
    1 女装 110 9
      

  10.   

    送分题,你们也要答对才行呀:
    1、
    select distinct 姓名 from tb 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(点击)
      

  11.   

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

  12.   

    楼上少个 tb a 嘿嘿
      

  13.   

    2.没排好版
    select   right(rtrim(类别),len(rtrim(类别))-1),sum(点击) from tb
    group by right(rtrim(类别),len(rtrim(类别))-1)
    order by sum(点击)
      

  14.   

    1.select distinct 姓名 from tablename where 分数>90
    2.select 类别,点击 from tablename2 group by 类别 order by 类别
      

  15.   

    --> 测试数据: #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
      

  16.   

    --1.假设每个同学的每科成绩都已录入
    select distinct 姓名 from 表 a where not exists(select * from 表 where 姓名=a.姓名 and 分数<>90)--2.
    select * from 表 order by stuff(类别,1,1,''),点击 desc
      

  17.   

    星辰技术社区:www.netcsharp.cn,我们将帮您以最快的速度找到最佳的解决方案 
      

  18.   


    字段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 --降序
      

  19.   


    是不是..男裤和女裤是一类...鞋也是....
    select distinct name from 表1 where 分数 = 90select * from 表2 order by right(类别,1),点击 
      

  20.   

    1.
    select distinct name from table1
    group by name
    having min(grade)=90
      

  21.   

    各位的猜测能力真是....!~@$@(($@,...暴强...LZ贴声放分...各种类型的回复都给臆想出来了...牛X,都当水贴好欺啊...~0~
      

  22.   

    1、
    select 姓名,count(分数) from 1
    where 分数='90'
    group by 姓名
    having count(分数)>12、
    select 类别,sum(点击)from 2
    group by 类别
    --哈哈,给点意见啊。我还是菜鸟。
      

  23.   

    --呵呵,刚第二句忘记排序了。排序如下:
    select 类别,sum(点击)as'点击'from 2 
    group by 类别 
    order by '点击'