• 闪存
• 博客
• 发言 小组
• 投递 新闻
• 提问 博问
• 添加 收藏
• 发布 招聘
• 文库

# 7个sql面试题,答对一个就给分

0 悬赏园豆：200 [已解决问题] 解决于 2014-10-30 13:54 http://lko2o.com/moon/article/48

0

select name from tablename where name not in (select distinct name from tablename where fenshu<=80)

delete a from 学生表 as a,(select  学号,姓名,课程编号,课程名称,分数,min(自动编号) as 自动编号  from 学生表 group by 学号,姓名,课程编号,课程名称,分数) as b where a.学号=b.学号 and a.姓名=b.姓名 and a.课程编号=b.课程编号 and a.课程名称=b.课程名称 and a.分数=b.分数 and a.自动编号!=b.自动编号

select * from (

select a.name as Aname,b.name as Bname from department as a,department as b

) as c where Aname<Bname

select 名称 from 商品表 as a group by 名称 having avg(进价)<2

select 准考证号 from 高考信息表  group by 准考证号 having sum(成绩)>600

select 准考证号 from 高考信息表 where (数学+语文+英语+物理+化学)>600

select year,

sum(case when month=1 then amount else 0 end) as m1,

sum(case when month=2 then amount else 0 end) as m2,

sum(case when month=3 then amount else 0 end) as m3,

sum(case when month=4 then amount else 0 end) as m4

from tablename group by year order by year

1

1、select name, fenshu from

(select name, min(fenshu) as fenshu from table group by name)M

where m.fenshu>80

@Moon.Orm塑造Orm经典: 送个肾6 128G？

@爱编程的大叔: 呵呵

0

select name from (

select name,min(fenshu) from table

group by name) t

where t.fenshu >=80

0

0

select * FROM (SELECT NAME,MIN(fenshu) AS total FROM insets GROUP BY NAME) AS t1
WHERE t1.total>80

0

0

Canrz | 园豆：200 (初学一级) | 2014-10-21 15:01
0

0

您需要登录以后才能回答，未注册用户请先注册