如下SQL语句中,怎么写才能实现当查询条件为某个字段时,只执行UNION前面(或后面)的语句?
SELECTM.JMDDATE,M.JMDMARKET,M.JMDMFID,M.JMDCATID,M.JMDWMID,M.JCHSJJJE,M.JCBHSJJJeFROM...
SELECT
M.JMDDATE,
M.JMDMARKET,
M.JMDMFID,
M.JMDCATID,
M.JMDWMID,
M.JCHSJJJE,
M.JCBHSJJJe
FROM JXCMFRAMEDAY M
Union
SELECT
S.JSDDATE,
S.JSDMKT,
S.JSDMFID,
S.JSDSUPID,
S.JSDWMID,
S.JCHSJJJE,
S.JCBHSJJJE
FROM JXCSUPPLIERDAY S 展开
M.JMDDATE,
M.JMDMARKET,
M.JMDMFID,
M.JMDCATID,
M.JMDWMID,
M.JCHSJJJE,
M.JCBHSJJJe
FROM JXCMFRAMEDAY M
Union
SELECT
S.JSDDATE,
S.JSDMKT,
S.JSDMFID,
S.JSDSUPID,
S.JSDWMID,
S.JCHSJJJE,
S.JCBHSJJJE
FROM JXCSUPPLIERDAY S 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询