当前位置: 代码迷 >> Sql Server >> 一下SQL语句有什么有关问题
  详细解决方案

一下SQL语句有什么有关问题

热度:72   发布时间:2016-04-27 12:41:04.0
一下SQL语句有什么问题?
select @[email protected]+Count(*)
  from (
select distinct(ProcessId)
from dbo.ProcessedInstance
where [email protected] and AcceptanceTime>@stime and AcceptanceTime<@etime
)

对sql不熟

------解决方案--------------------
select @[email protected]+Count(*)
from (
select distinct(ProcessId)
from dbo.ProcessedInstance
where [email protected] and AcceptanceTime>@stime and AcceptanceTime<@etime
) t
------解决方案--------------------
SQL code
select @[email protected]+Count(*)  from (select distinct(ProcessId)from dbo.ProcessedInstancewhere [email protected] and AcceptanceTime>@stime and AcceptanceTime<@etime) t你是吧你面的查询语句作为表来查询,所以得去个别名t
  相关解决方案