急!如何几个语句的查询结果连接在一起?
有7个表,tb1~tb7,每个表的结果相同,现在想查每个表里的两列:uin,type,并把结果连接在一起,该怎么做啊?
[解决办法]
select uin,type from tb1
union
select uin,type from tb2
UNION
select uin,type from tb3
上面这样就可以了~或union all
看一个DOC就知道怎么做的~
发布时间: 2012-06-12 14:21:25 作者: rapoo
急!如何几个语句的查询结果连接在一起?
有7个表,tb1~tb7,每个表的结果相同,现在想查每个表里的两列:uin,type,并把结果连接在一起,该怎么做啊?
[解决办法]
select uin,type from tb1
union
select uin,type from tb2
UNION
select uin,type from tb3
上面这样就可以了~或union all
看一个DOC就知道怎么做的~