假设有数据表
学生(学号,姓名,生日,性别,民族)
成绩(学号,总成绩)
将不是汉族的学生总成绩提高百分之十,可运行下列更新查询:
update 成绩 set 总成绩=总成绩*1.1 where
学号 in (select 学号 from 学生 where 民族<>
'汉族')
10:SELECT A.民族, Count(A.民族) AS 人数 INTO mz
FROM (SELECT JS.mzdm, IIf([JS]![mzdm]='01','汉族','其它民族') AS 民族 FROM JS) AS A
GROUP BY A.民族
ORDER BY A.民族 DESC
11:
SELECT KCAP.bjbh AS 班级编号, Mid([KCAP].[xqbm],3,2) &"-" &Mid([KCAP].[xqbm],13,1) AS 学期编码, Count(KCAP.kcdm) AS 开课门数, Sum(KC.kss) AS 总课时数
FROM KC INNER JOIN KCAP ON KC.kcdm = KCAP.kcdm
GROUP BY KCAP.bjbh, Mid([KCAP].[xqbm],3,2) &"-" &Mid([KCAP].[xqbm],13,1)
ORDER BY KCAP.bjbh, Mid([KCAP].[xqbm],3,2) &"-" &Mid([KCAP].[xqbm],13,1)
12:
SELECT Left([KCAP].[xqbm],9) AS 学年, KCAP.bjbh AS 班级编号, Count(KCAP.kcdm) AS 开课门数, Sum(KC.kss) AS 总课时数
FROM KC INNER JOIN KCAP ON KC.kcdm = KCAP.kcdm
GROUP BY Left([KCAP].[xqbm],9), KCAP.bjbh
ORDER BY Left([KCAP].[xqbm],9)
13:
SELECT XS.bjbh AS 班级编号, XS.xh AS 学号, XS.xm AS 姓名, Avg(CJ.cj) AS 平均成绩 INTO bjcj
FROM XS INNER JOIN CJ ON XS.xh = CJ.xh
GROUP BY XS.bjbh, XS.xh, XS.xm
HAVING (((XS.bjbh) In (SELECT bjbh FROM xs WHERE xm = "史建平")) AND ((Avg(CJ.cj))>75))
ORDER BY Avg(CJ.cj) DESC
14:
SELECT YXDM.yxmc AS 院系统名称, YXDM.zymc AS 专业名称, IIf(M.男生人数 Is Null,0,M.男生人数) AS 男生人数, IIf(F.女生人数 Is Null,0,F.女生人数) AS 女生人数
FROM (YXDM LEFT JOIN (SELECT XS.yxzydm, Count(XS.xb) AS 男生人数
FROM XS
WHERE (((XS.xb)="男"))
GROUP BY XS.yxzydm) AS M ON YXDM.yxzydm = M.yxzydm) LEFT JOIN (SELECT XS.yxzydm, Count(XS.xb) AS 女生人数
FROM XS
WHERE (((XS.xb)="女"))
GROUP BY XS.yxzydm) AS F ON YXDM.yxzydm = F.yxzydm
ORDER BY YXDM.yxmc
select * from a where 出生地='云南' or 民族='汉'查询结果就满足你的要求,但是要注意的是,a表中原始数据不会有变化,不会因为你做了一次查询就把a中的数据做了删除或者修改,你的查询结果是一个临时表,不影响原始表。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)