我无法在同一个table.column中添加两个列,但有两个不同的值。
如何将以下两个查询一起添加到两个新列中,每个列都有自己的值;
SELECT
... more columns ...
components.description,
FROM
...
WHERE
graphiccards.id = systems.id AND
components.id = graphiccards.component_id;
SELECT
components.description
FROM
...
WHERE
components.id = mainboards.component_id AND
mainboards.id = systems.mainboard_id
我希望这两个结果位于两个不同列的同一行。
答案 0 :(得分:0)
您可能希望查看UNION
运算符
select
components.description
stuff as second_column
from mytable where conditions
union
select
components.description
stuff2 as second_column
from mytable2 where conditions2
您只需要确保具有相同名称的相同nr列。