使用Microsoft SQL 2000,我想将多个表(A,B,C和D)连接在一起.我知道桌子A总是存在的.但是,我只知道至少有一种表格形式(B,C,D)存在.
我有什么方法可以做这样的事情来完成我想做的事情?
Select * form table a
If table b exists left Join table b on a.id = b.id
If table c exists left Join table c on a.id = c.id
If table d exists left Join table d on a.id = d.id
Run Code Online (Sandbox Code Playgroud)