/* result 1 */
select Id, Name
from Items
/* result 2 */
select Id,
Alias
from ItemAliases
where Id in (
select Id, Name
from table abc
)
SQL Server 2008 を使用しています。
上記の例を使用すると、私がやろうとしていることは非常に簡単です。
クエリ 1 の結果を返し、クエリ 2 の結果を返す必要があります。
ただし、クエリ 2 は、結果 1 のレコードのみを含めるようにフィルター処理する必要があります。
これが、私が最終的に何をしたいのかを示すための私の試みです。
VAR A = (
select Id, Name
from Items
)
/* result 1 */
select A.*
/* result 2 */
select Id,
Alias
from ItemAliases
where Id in ( A.Id )