當前位置:首頁 » 成績查詢 » sql查詢個人成績

sql查詢個人成績

發布時間: 2021-01-12 16:13:38

A. SQL查詢個人最高成績大於90或者最低成績小於60的的人...

--根據你的描述 我就只能寫成這個樣子了
--希望解決了樓主的問題
select * from 表名 where 成績>90 or 成績<60

B. 用SQL選出每個人成績的最高紀錄

SELECT 工號,max(成績) as 最高成績
from 成績表
group by 工號

C. SQL查詢平均成績

select
classid
as
班級編號,max(case
when
sex=0
then
avg_grade
else
0
end)
as
男生平均成績版權,
max(case
when
sex=1
then
avg_grade
else
0
end)
as
女生平均成績
from
(select
classid,sex,avg(grade)
as
avg_grade
from
student
a
inner
join
sc
b
on
a.id=b.id
)
t
group
by
classid

D. 簡單SQL語句,查詢成績

select * from xs
inner join
(
select km,max(fs) as fs from xs group by km
)w
on xs.km = w.km and xs.fs = w.fs

這樣行復不?制憑想像寫的,請參考

E. SQL查詢問題,在一張表裡面怎麼查詢所有人的成績

selectname,sum(score)

這里有題目的答案回:答

http://www.cnblogs.com/tenghoo/archive/2007/06/11/779240.html

F. SQL查詢學生成績

select a.studentId,a.name,a.sex,c.cid,b.cname,c.score
into TableA
from Student a, Course b, Grade c
where a.studentId=c.studentId and c.cid=b.cid

select a.studentId,a.name,a.sex,
sum(case cname when "語文" then score else 0 end) as 語文,
sum(case cname when "數學" then score else 0 end) as 數學,
sum(case cname when "英語" then score else 0 end) as 英語,
sum(case cname when "哲學內" then score else 0 end) as 哲學,
sum(score)*1.0/4 as "平均成績容"

G. 查詢成績的SQL語句是什麼

不知道你的表結構是什麼啊?
例如表的欄位有姓名、課程、成績的話專
每人的總成績:SELECT 姓名,SUM(成績) FROM 表名屬 GROUP BY 姓名
每人的平均成績:SELECT 姓名,SUM(成績)/COUNT(*) FROM 表名 GROUP BY 姓名
每人的課程門數:SELECT 姓名,COUNT(*) FROM 表名 GROUP BY 姓名

H. 如何通過一條SQL,查詢出最大成績和姓名

你好!來
正確答案:
select
a.*
from
tal
a,(select
姓名自,max(成績)
as
成績
from
tal
group
by
姓名)
b
where
a.姓名=b.姓名
and
a.成績=b.成績
如有疑問,請追問。

I. 查詢學生總成績的sql語句怎麼編寫

select 學生.學號 as 姓名, sum(成績.分數) as 總分
from 學生
left join 成績 on 成績.學號=學生.學號
group by 學生.學號

sql語句專

  1. 更新:update table1 set field1=value1 where 范圍

  2. 查找屬:select * from table1 where field1 like '%value1%' (所有包含'value1'這個模式的字元串)

  3. 排序:select * from table1 order by field1,field2 [desc]

  4. 求和:select sum(field1) as sumvalue from table1

  5. 平均:select avg(field1) as avgvalue from table1

  6. 最大:select max(field1) as maxvalue from table1

  7. 最小:select min(field1) as minvalue from table1[separator]

J. sql語句查詢橫排成績表中成績最好的學生姓名、科目和成績

/*
讓我們假設 這個表叫ExamResults.
name - 姓名
subjects - 科目內
grades - 成績容
*/
--then the query is as following.
select
er1.name, er1.subjects, er1.grades
from ExamResults as er1, ExamResults as er2
where er1.name = er2.name and er1.grades > er2.grades

熱點內容
武漢大學學生會輔導員寄語 發布:2021-03-16 21:44:16 瀏覽:612
七年級學生作文輔導學案 發布:2021-03-16 21:42:09 瀏覽:1
不屑弟高考成績 發布:2021-03-16 21:40:59 瀏覽:754
大學畢業證會有成績單 發布:2021-03-16 21:40:07 瀏覽:756
2017信陽學院輔導員招聘名單 發布:2021-03-16 21:40:02 瀏覽:800
查詢重慶2018中考成績查詢 發布:2021-03-16 21:39:58 瀏覽:21
結業考試成績怎麼查詢 發布:2021-03-16 21:28:40 瀏覽:679
14中醫醫師資格筆試考試成績查分 發布:2021-03-16 21:28:39 瀏覽:655
名著賞析課程標准 發布:2021-03-16 21:27:57 瀏覽:881
北京大學商業領袖高端培訓課程 發布:2021-03-16 21:27:41 瀏覽:919