请问如何能嵌套使用select count(*) from tableName 所得到的值?

benzite 2003-10-17 05:22:52
下面这个语句不能不执行,只是用来说明一下我的意图:
slect sum1*2 from (
select count(*) as sum1 from table1)
...全文
175 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
txlicenhe 2003-10-17
  • 打赏
  • 举报
回复
slect sum1*2 from ( select count(*) as sum1 from table1) a

select (select count(*) from table1)*2 from a
qdubit 2003-10-17
  • 打赏
  • 举报
回复
slect sum1*2 from ( select count(*) as sum1 from table1) a
shuiniu 2003-10-17
  • 打赏
  • 举报
回复
slect sum1*2 from ( select count(*) as sum1 from table1) a
-----------------------------------------------------------
"派生表"的应用
LoveSQL 2003-10-17
  • 打赏
  • 举报
回复
select (select count(*) from table1)*2 as sum
yujohny 2003-10-17
  • 打赏
  • 举报
回复
slect sum1*2 from ( select count(*) as sum1 from table1) a

select (select count(*) from table1)*2 from a
伍子V5 2003-10-17
  • 打赏
  • 举报
回复
slect sum1*2 from (
select count(*) as sum1 from table1) a

34,575

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧