开发者

inner join function with params

Is it possi开发者_如何学JAVAble to do this

SELECT * 
  FROM xcu
  JOIN fun_Blocked_Dates('2011-01-01', '2012-01-01', xcu.uid) bd ON bd.uid = xcu.uid 

It seems that function Blocked_Dates is unable to accept xcu.uid as a valid parameter.

I get an error "Incorrect syntax near 'xcu'."


Perhaps this will work for you.

SELECT * 
  FROM xcu
  CROSS APPLY fun_Blocked_Dates('2011-01-01', '2012-01-01', xcu.uid)

You can't use fields from tables as parameters to a function in a join. You need to use cross apply.


What you want is Cross Apply

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜