如何串联2个查询结果 [英] How to concatenate 2 query results

查看:102
本文介绍了如何串联2个查询结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个查询.第一个查询输出是13列,第二个查询只有一个列.

如何连接这两个查询?

I have two queries. The first query output is 13 columns and the second has only one column.

How do I concatenate these two queries?

推荐答案

您不能.除非它们有一个共同的ID,否则没有明智的方式来执行此操作,在这种情况下,您应该使用连接进行单个查询.如果他们没有共同的ID,您怎么知道行数甚至是相同的?
You can''t. There''s no sensible way for you to do it, unless they have an id in common, in which case you should do a single query with a join. If they don''t have an id in common, how do you know the number of rows will even be the same ?


这篇关于如何串联2个查询结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆