加一个固定列就行了。
例如:t1和t2都有id列,现在要知道union all后哪些数据来自t1,哪些来自t2,加个标识列re select id,'t1' as re from t1
union all
select id,'t2' from t2;
例如:t1和t2都有id列,现在要知道union all后哪些数据来自t1,哪些来自t2,加个标识列re select id,'t1' as re from t1
union all
select id,'t2' from t2;
调试欢乐多
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货