我使用此查詢這是不允許的:子查詢返回多個值當子查詢
select *
from Master_Shares
where (PartnerId = (select distinct PartnerId from Master_Shares))
這引發錯誤:
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
這是什麼查詢應該做的事情?這只是過濾行,對吧?到有PartnerId設置的那些?爲什麼你不會簡單地使用WHERE子句來過濾它們(比如WHERE PartnerId不爲空)? –