如何使用表值函数i MSSql 2012进行连接,如下面的查询?
SELECT m1.id, m1.oid, m1.id2
FROM dbo.Match(484066) AS m1 INNER JOIN
dbo.Match(m1.id2) AS m2 ON m1.id2 = m2.id INNER JOIN
dbo.Match(m2.id2) AS m3 ON m2.id2 = m3.id AND m1.id = m3.id2
答案 0 :(得分:3)
SELECT m1.id, m1.oid, m1.id2
FROM dbo.Match(484066) AS m1 CROSS APPLY
dbo.Match(m1.id2) AS m2 CROSS APPLY
dbo.Match(m2.id2) AS m3
这就是你想要的吗?