加入两个 SQL 查询生成一个 table 没有标题

Join two SQL Queries to produce one table without headings

我做了两个 SQL 查询都带回了我想要的信息,这很好,我想知道我是否可以将 result 合并为一个而不是 2 个单独的结果,我不知道不知道这是否可以完成,但要么不显示标题,要么显示新的自定义标题。

我正在使用的 SQL 代码如下

SELECT  T_PRODUCT_NUTRITIONALINFORMATION.C_ENERGY_KJ ,T_PRODUCT_NUTRITIONALINFORMATION.C_PROTEIN, T_PRODUCT_SELLING_PRICEDEFINITION.C_NETPRICE
FROM ((T_PRODUCT
INNER JOIN T_PRODUCT_NUTRITIONALINFORMATION ON T_PRODUCT.C_NUTRITIONALINFORMATION = T_PRODUCT_NUTRITIONALINFORMATION.C_ID)
INNER JOIN T_PRODUCT_SELLING_PRICEDEFINITION ON T_PRODUCT.C_SELLING = T_PRODUCT_SELLING_PRICEDEFINITION.C__OWNER_)
WHERE C_CODE LIKE 'STK000832';


SELECT  T_PRODUCT_NUTRITIONALINFORMATION.C_ENERGY_KJ ,T_PRODUCT_NUTRITIONALINFORMATION.C_CARBOHYDRATESOFWHICHARESUGAR, T_PRODUCT_SELLING_PRICEDEFINITION.C_NETPRICE
FROM ((T_PRODUCT
INNER JOIN T_PRODUCT_NUTRITIONALINFORMATION ON T_PRODUCT.C_NUTRITIONALINFORMATION = T_PRODUCT_NUTRITIONALINFORMATION.C_ID)
INNER JOIN T_PRODUCT_SELLING_PRICEDEFINITION ON T_PRODUCT.C_SELLING = T_PRODUCT_SELLING_PRICEDEFINITION.C__OWNER_)
WHERE C_CODE LIKE 'STK000832';

结果如下

下面是我想要达到的结果

当然,您可以使用 UNION ALL

SELECT  T_PRODUCT_NUTRITIONALINFORMATION.C_ENERGY_KJ AS NewHeading1,
T_PRODUCT_NUTRITIONALINFORMATION.C_PROTEIN AS NewHeading2, 
T_PRODUCT_SELLING_PRICEDEFINITION.C_NETPRICE AS NewHeading3
FROM ((T_PRODUCT
INNER JOIN T_PRODUCT_NUTRITIONALINFORMATION ON T_PRODUCT.C_NUTRITIONALINFORMATION = T_PRODUCT_NUTRITIONALINFORMATION.C_ID)
INNER JOIN T_PRODUCT_SELLING_PRICEDEFINITION ON T_PRODUCT.C_SELLING = T_PRODUCT_SELLING_PRICEDEFINITION.C__OWNER_)
WHERE C_CODE LIKE 'STK000832'
UNION ALL
SELECT  T_PRODUCT_NUTRITIONALINFORMATION.C_ENERGY_KJ AS NewHeading1,
T_PRODUCT_NUTRITIONALINFORMATION.C_CARBOHYDRATESOFWHICHARESUGAR AS NewHeading2,
T_PRODUCT_SELLING_PRICEDEFINITION.C_NETPRICE AS NewHeading3
FROM ((T_PRODUCT
INNER JOIN T_PRODUCT_NUTRITIONALINFORMATION ON T_PRODUCT.C_NUTRITIONALINFORMATION = T_PRODUCT_NUTRITIONALINFORMATION.C_ID)
INNER JOIN T_PRODUCT_SELLING_PRICEDEFINITION ON T_PRODUCT.C_SELLING = T_PRODUCT_SELLING_PRICEDEFINITION.C__OWNER_)
WHERE C_CODE LIKE 'STK000832';