Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有表一和表二。表一有 zoe 和 clo 列,但表二有 oez 和 olc,它就像这样 zoe=oez 和 cloe=olc 我怎样才能合并它们?
我不确定这是否是您要查找的内容,但使用union all可以将结果合并为单个表。但是,如果这将是一个永久表,则您必须创建一个新的主键。
union all
Select a.id as id, a.value as value From a UNION ALL Select b.id1 as id, b.value1 as value From b Group by id, value
例子:
http://www.sqlfiddle.com/#!2/093e1/4