2017-09-27 17 views
0

I가 다음 쿼리,이 오류가 수신하고 있지만 :나는 "하나 개의 표현이 EXISTS와 하위 쿼리가 도입되지 않을 때 선택 목록을 지정할 수 있습니다"수정해야

Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.

(select replace((stuff (itemdata,1,66,'')), '<BodyText>', '')as text 
from charts 
where itemtype = 'DocumentItems_RichText' and checksum ='1' 
union all 
select stuff (itemdata,1,66,'') 
from charts 
where itemtype = 'DocumentItems_RichText' 
and checksum <>'1')AS Content 
+0

... –

+0

당신은 그 오류가 발생합니다. 이 하위 쿼리가 오류가 발생 했습니까? 하나의 열만 반환하는 것으로 보입니다. –

답변

0

을 이 시도 할 수 있습니다 : 당신이 IN``에 사용되는 하위 쿼리처럼 하나를 반환해야 하위 쿼리에서 둘 이상의 컬럼/식을 선택하면 정확한 여기에 물어 무엇

SELECT Content 
FROM 
(
select replace((stuff (itemdata,1,66,'')), '<BodyText>', '')as text 
from charts 
where itemtype = 'DocumentItems_RichText' 
    and checksum ='1' 
union all 
select stuff (itemdata,1,66,'') 
from charts 
where itemtype = 'DocumentItems_RichText' 
    and checksum <>'1' 
) DS (Content);