How to pass parameters to Table Valued Function

后端 未结 3 1099
甜味超标
甜味超标 2021-02-05 04:57

I want to do something like

select * from tvfHello(@param) where @param in (Select ID from Users)
3条回答
  •  余生分开走
    2021-02-05 04:59

    You need to use CROSS APPLY to achieve this

    select 
        f.* 
    from 
        users u
        cross apply dbo.tvfHello(u.ID) f
    

提交回复
热议问题