能不能用一条SQL语句查询不关联的两个表啊?
就是一个导出表里面显示两个数据库表的内容。。。
------解决方案--------------------用 cross join
------解决方案----------------------try1:
select * from a,b
--try2:
select * from a
union all select * from b
------解决方案----------------------如果两个列能区分大小排序.
--假设行数相同,如果不同,自己考虑是该用left join/right join/full join
select t1.score , t2.score from
(
SELECT * , px=(SELECT COUNT(Score) FROM tb1 WHERE Score > a.Score) + 1 FROM tb1 a
) t1,
(
SELECT * , px=(SELECT COUNT(Score) FROM tb2 WHERE Score > a.Score) + 1 FROM tb2 a
) t2
where t1.px = t2.px
------解决方案--------------------cross join 如果每个表有1万条数据出来就是1亿了,太恐怖