pass parameter in table valued function using select statement

前端 未结 1 1791
野趣味
野趣味 2020-12-29 03:03

I have created a table valued return function which returns me a table . here is call of my function as follow

SELECT * FROM dbo.[StateFixedTaxesCalculation         


        
相关标签:
1条回答
  • 2020-12-29 04:04

    use outer/cross apply:

    select *
    from Employee as E
        cross apply dbo.[StateFixedTaxesCalculation](3020, E.EmployeeId, 1, 1006) as TC
    

    if you still have to filter by TC.EmployeeId = E.EmployeeId, you can do this with subquery:

    select *
    from Employee as E
        cross apply (
            select TT.*
            from dbo.[StateFixedTaxesCalculation](3020, E.EmployeeId, 1, 1006) as TT
            where TT.EmployeeId = E.EmployeeId
        ) as TC
    
    0 讨论(0)
提交回复
热议问题