你能帮我么?我有一个主要(SELECT),我在其中使用更多的下一个选择命令,但劣质选择返回给我的价值多于一个。
SELECT table1.column1
AS table.refer, table2.column2 AS table.value,
--Here is my problem:
(select count(table.column.id) FROM table1
left outer join table1 on table1.column1 = table.column
LEFT outer join table2 on table2.column2 = table1.column1
LEFT OUTER JOIN table3 on table3.column3 = table2.column2
WHERE table1.column1 = (23212 " This value contains more data) AND table2.column2 = value AND YEAR(table1.column1) = YEAR(GETDATE() GROUP BY table.refer)
FROM table1 left outer join table1 on table1.column1 = table.column
LEFT outer join table2 on table2.column2 = table1.column1
LEFT OUTER JOIN table3 on table3.column3 = table2.column2
WHERE table1.name1 in (23210, 23211, 23212, 4882525, 67735166, 74605160) AND table2.name2 in (15739, 15744, 15743, 15741, 15735, 15745)
GROUP BY table.refer, table.value
主要选择的重要值是 table.refer。我只需要一张桌子。请参阅第二次选择。但是对于所有数据。
我为此检查光标功能或为此选择数据或字段[]创建新表,但我不知道该怎么做。请帮我。