0
我早就蜂房的查询,其中有10个连接和大量的条件,下面是3个条件加入基于条件
1) If id is not equal to XFG or GHT, use field sid
join ABC_Tables on sid
join CDE_Tables on sid
2) If id is equal to XFG or GHT, Tested is null, use field pid
join ABC_Tables on kid
join CDE_Tables on kid
3) If id is equal to XFG or GHT, Tested is not null, use field pid
join ABC_Tables on kid
join CDE_Tables on kid
我在做什么,
select 1 conditions
union all
select 2 conditions
union all
select 3 conditions
我在做正确的。以上问题的替代方法是什么?
请提供您尝试过的SQL,表的结构,示例数据和该示例的预期结果。请注意,首先查看您的条件2和条件3看起来过于相似以作为单独的条件提及。 – trincot