我试图从不同的表导出数据。我从表中删除了相同的标题

时间:2017-08-08 13:59:13

标签: mysql

我正在尝试从不同的表中导出数据。我从表中删除了相同的标题。

从a中选择locationid,qty, 从b中选择locationid,qty, 从c

中选择locationid,qty

理想情况下,我想查询我的数据  locationid qtyA qtyB qtyc

有人可以帮我解决SQL查询吗?

1 个答案:

答案 0 :(得分:1)

您可以尝试以下查询吗?

ANSI-89中的第一个:

refractSphereCamera.renderTarget.mapping = new THREE.CubeRefractionMapping();

如果您需要按locationId(已加入)进行过滤:

SELECT 
a.locationid as locationIdA, a.qty as qtryA,
b.locationid as locationIdB, b.qty as qtryB,
c.locationid as locationIdC, c.qty as qtryC
FROM
a, b, c

您也可以尝试使用ANSI-92:

SELECT 
a.locationid as locationIdA, a.qty as qtryA,
b.locationid as locationIdB, b.qty as qtryB,
c.locationid as locationIdC, c.qty as qtryC
FROM
a, b, c
WHERE
a.locationid=b.locationid 
AND
b.locationid=c.locationid