请问怎么将以下两个句子连接?

Stannislas 2006-07-31 05:31:22
以下两个单独都可以取出数据我想把数据到一张表里怎么连接
declare @count int select @count=count(1)
from JobOject where ishit='1'
declare @allcount int select @allcount=count(1) from JobOject where ToDep ='1'
if @count >0 and @allcount>0
select '名称' as DepartmentName, @count as '分子', @allcount as '分母'
else select '名称' as DepartmentName, 0 as '分子', 0 as '分母'

declare @count1 int select @count1=count(1)
from JobOject where ishit='1'
declare @allcount1 int select @allcount1=count(1) from JobOject where ToDep ='1'
if @count >0 and @allcount>0
select '名称' as DepartmentName, @count as '分子', @allcount as '分母'
else select '名称' as DepartmentName, 0 as '分子', 0 as '分母'

...全文
149 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

34,593

社区成员

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

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