sql查詢個人成績
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語句專
更新:update table1 set field1=value1 where 范圍
查找屬:select * from table1 where field1 like '%value1%' (所有包含'value1'這個模式的字元串)
排序:select * from table1 order by field1,field2 [desc]
求和:select sum(field1) as sumvalue from table1
平均:select avg(field1) as avgvalue from table1
最大:select max(field1) as maxvalue from table1
最小: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