R(X,Y)除以S(Y,Z)的一般实现方式:
select distinct R.X from R R1 where not exists (select S.Y
from Swhere not exists(select * from R R2where R2.X=R1.X
and R2.Y=S.Y))
跟数学相除一样,select 字段1/字段2 from 表名,参考:
保留4位小数
SELECT b.countRating ,round(b.totalRating/b.countRating,4) avgRating from 表名
请给出你原题的描述及表结构,是哪个集合除以哪个集合,你目前问题里完全没有描述题目内容和你的代码是怎样的。