select count(*) 的问题

[复制链接]
查看11 | 回复3 | 2019-10-14 05:03:05 | 显示全部楼层 |阅读模式
不可以,这样只能够显示3个表记录数的乘积
回复

使用道具 举报

千问 | 2019-10-14 05:03:05 | 显示全部楼层
以下SQL文可以实现你的目的select count(表1.*) as cout1,b.cout2,b.cout3from 表1,
(select count(表2.*) as cout2,a.cout3
from 表2,(select count(表3.*) as cout3 from 表3) as a) as b不好意思,以上的回答我没有跑过,行不通.呵呵.下边的语句才是你需要的.select count(*) as cout1,(select count(*) from KS_Class) as cout2,(select count(*) from KS_Article) as cout3 from KS_User你再试下吧.
回复

使用道具 举报

千问 | 2019-10-14 05:03:05 | 显示全部楼层
顶这个,我看过了可以用select count(*) as cout1,(select count(*) from KS_Class) as cout2,(select count(*) from KS_Article) as cout3 from KS_User
回复

使用道具 举报

千问 | 2019-10-14 05:03:05 | 显示全部楼层
当然可以。。试试下面:select count(*) from 表1,表2,表3
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行