如何让MySQL 两个表的列合并叠加成一个新的表,求助
1个回答
展开全部
SQL code?
1
2
3
select uid,names,addtime from tb1 where ...
union --all 去掉all可以去重复
select uid,names,addtime from tb2 where ...
/**
这个语句里字段的别名都是取第一个查询的字段名或其别名作为查询结果集的字段名的
*/
select uid,names,addtime from tb1 where ...
union --all 去掉all可以去重复
select uid,names,addtime from tb2 where ...
/*上边查询结果集的字段名是uid,names,addtime*/
select uid,names,addtime from tb1 where ...
union --all 去掉all可以去重复
select uid,titles,addtime from tb2 where ...
/*上边查询结果集的字段名是uid,names,addtime*/
select uid,titles,addtime from tb1 where ...
union --all 去掉all可以去重复
select uid,names,addtime from tb2 where ...
/*上边查询结果集的字段名是uid,titles,addtime*/
1
2
3
select uid,names,addtime from tb1 where ...
union --all 去掉all可以去重复
select uid,names,addtime from tb2 where ...
/**
这个语句里字段的别名都是取第一个查询的字段名或其别名作为查询结果集的字段名的
*/
select uid,names,addtime from tb1 where ...
union --all 去掉all可以去重复
select uid,names,addtime from tb2 where ...
/*上边查询结果集的字段名是uid,names,addtime*/
select uid,names,addtime from tb1 where ...
union --all 去掉all可以去重复
select uid,titles,addtime from tb2 where ...
/*上边查询结果集的字段名是uid,names,addtime*/
select uid,titles,addtime from tb1 where ...
union --all 去掉all可以去重复
select uid,names,addtime from tb2 where ...
/*上边查询结果集的字段名是uid,titles,addtime*/
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询