SQL SERVER错误:“为变量赋值的SELECT语句不得与数据检索操作结合使用。” [英] SQL SERVER Error: "A SELECT statement that assigns a value to a variable must not be combined with data-retrieval operations."
本文介绍了SQL SERVER错误:“为变量赋值的SELECT语句不得与数据检索操作结合使用。”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决;它是版权的材料,这就是为什么我删除它
Solved; it is copy right material thats why i removed it
推荐答案
我不是你在这个查询中尝试做什么。就错误而言,这可能是解决方案。我肯定,但试试希望它的工作原理:)。将其拆分为两个不同的查询。
I don't what your trying to do in this query. As far the error is concerned this could be solution. I am sure but give a try hope it works :). Split it into two different queries.
SELECT @CRIME_DETAIL_1=count(*)
FROM t_crime_detail
where RECORD_SYNC_FROM='PS'and PS_CD=@PS_CD
and CONVERT(date, RECORD_CREATED_ON)=@REG_DT;
SELECT ( SELECT t_fir_registration.PS_CD FROM t_crime_detail INNER JOIN t_fir_registration ON t_crime_detail.FIR_REG_NUM=t_fir_registration.FIR_REG_NUM) AS PS_CD
FROM t_crime_detail
where RECORD_SYNC_FROM='PS'and PS_CD=@PS_CD
and CONVERT(date, RECORD_CREATED_ON)=@REG_DT;
这篇关于SQL SERVER错误:“为变量赋值的SELECT语句不得与数据检索操作结合使用。”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文