sql 两个表记录数相除

来源:百度知道 编辑:UC知道 时间:2024/06/15 10:19:15
有两个表table1,和table2,我想得到两个表count(*)记录数的比值,怎么用,
我在sql server中用select (select count(*) from table1)*1.00/(selcet count(*) from table2) as 百分比,在sql server 中可以用,到access中不能执行了,问?
哪位兄弟有更好的办法,教我。

update table1 dcount(*,ziduan)

可以试下如下方法:
select table1.count(*)*1.00/table2.count(*) as 百分比
from table1, table2
另处,你的方法在sql server中可以的话,一般来说在access中也可用,两种数据库都是完全遵守SQL语法标准的。只是一些规则存储过程等无法移植。