SELECT [SKULL].[dbo].[reports].[idnumber], [SKULL].[dbo].[reports].[subid]
FROM [SKULL].[dbo].[reports]
WHERE reportColumn = (SELECT DISTINCT(reportColumn)
FROM [SKULL].[dbo].[reports]
WHERE [SKULL].[dbo].reports.reportColumn
LIKE '%someword%')
我得到一個錯誤信息說如何在SQL Server 2012中運行子查詢?
Msg 512, Level 16, State 1, Line 2
Subquery returned more than 1 value.
This is not permitted when the subquery follows =, !=, <, <= , >, >= or
when the subquery is used as an expression.
感謝。
我建議你閱讀錯誤信息,因爲它告訴你發生了什麼事。當子查詢返回多行時,您的查詢仍然有意義嗎? – usr