mysql union all 连表查询如何知道结果来自哪张表?

select
w.woType,
‘NO_HIS’ as dataFrom
from
workorder_complet_info w
where
w.workOrderNo = ‘xxxxxx’
union all
select
w.woType,
‘HIS’ as dataFrom
from
workorder_complet_info_his w
where
w.workOrderNo = ‘xxxxxx’;

红色的是核心。

[En]

The red one is the core.

Original: https://www.cnblogs.com/austinspark-jessylu/p/16262005.html
Author: 爷的眼睛闪亮
Title: mysql union all 连表查询如何知道结果来自哪张表?

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/7203/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

免费咨询
免费咨询
扫码关注
扫码关注
联系站长

站长Johngo!

大数据和算法重度研究者!

持续产出大数据、算法、LeetCode干货,以及业界好资源!

2022012703491714

微信来撩,免费咨询:xiaozhu_tec

分享本页
返回顶部