次のようなクエリがあるとします。
Select col1,
col2,
(select count(smthng) from table2) as 'records'
from table1
「レコード」列でnullにならないようにフィルタリングしたい。
これはできない:
Select col1,
col2,
(select count(smthng) from table2) as 'records'
from table1
where records is not null
私が思いついた最善の方法は、この結果セットをテーブル値パラメーターに書き込み、その結果セットに対して別のクエリを作成することです。何か案は?