W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
Oracle 算術運算符包括+
、-
、*
、/
四個,其中/
獲得的結果是浮點數(shù)。
案例1、求2018年上學期數(shù)學的平均成績。
select a.*, b.coursename, c.stuname
from score a, course b, stuinfo c
where a.courseid = b.courseid
and a.stuid = c.stuid;
select b.coursename, sum(a.score) / count(1)
from score a, course b
where a.courseid = b.courseid
and a.courseid = 'R20180101'
group by b.coursename;
Oracle 關系運算符在 where
條件語句當中經(jīng)常使用到,常用的關系如下:
符號 | 解釋 | 符號 | 解釋 |
---|---|---|---|
= | 等于 | <>或者!= | 不等于 |
> | 大于 | >= | 大于或者等于 |
< | 小于 | <= | 小于或者等于 |
Oracle 的邏輯運算符有三個:AND
、OR
、NOT
。
案例2、查看2018年上學期數(shù)學成績在85-95分之間的同學:
select a.*,b.coursename,c.stuname from score a,course b,stuinfo c where a.courseid=b.courseid and a.stuid=c.stuid and a.score>='85'and a.score<='95'
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: