我有一个用户定义的功能:
create function ut_FooFunc(@fooID bigint,@anotherParam tinyint) returns @tbl Table (Field1 int,Field2 varchar(100)) as begin -- blah blah end
现在我想在另一个表上加入这个,就像这样:
select f.ID,f.Desc,u.Field1,u.Field2 from Foo f join ut_FooFunc(f.ID,1) u -- doesn't work where f.someCriterion = 1
换句话说,对于SomeCriterion为1的所有Foo记录,我想看到Foo ID和Desc,以及从ut_FooFunc返回的Foo.ID输入的Field1和Field2的值.
这样做的语法是什么?