I want to fetch record from table with WHERE IN
clause like this:
Select *
From Table_A
Where table_id IN (Query X that returns multiple or single id)
Now I want to move X query to a SQL Server function because it will use multiple places and want to call query like that:
Select *
From Table_A
Where table_id IN dbo.function(parameters)
Is it possible to do this? If yes then which will be the type of function (scalar or table function)?