次のように、スカラー値の選択クエリをパラメーターとして関数に渡したいと思います。
select * from dbo.ftLatestOrderLines(select max(id) from [orders])
db サーバーは次のエラーをスローします。
Msg 156, Level 15, State 1, Line 3
Incorrect syntax near the keyword 'select'.
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near ')'.
クエリをパラメーターとして渡すための回避策はありますか?