SELECT
*
FROM
(
SELECT
订单ID,
b.`公司名称`
FROM
`订单` AS a
LEFT JOIN `运货商` AS b ON a.`运货商` = b.`运货商ID`
WHERE
`订单ID` IN (10248, 10254)
) a
FULL JOIN (
SELECT
`订单ID`,
`产品名称`
FROM
订单明细 AS a
LEFT JOIN `产品` AS b ON a.`产品ID` = b.`产品ID`
WHERE
`订单ID` IN (10248, 10254)
) b ON a.订单ID = b.订单ID
select a.* ,b.产品名称 from
(
SELECT 订单ID,b.`公司名称`FROM `订单` AS aLEFT JOIN `运货商` AS b ON a.`运货商` = b.`运货商ID`where `订单ID` in (10248,10254
) a
left join
(
SELECT
`订单ID`,`产品名称`
FROM
订单明细 AS a
LEFT JOIN
`产品` as b
ON a.`产品ID`=b.`产品ID`
where `订单ID` in (10248,10254)
) b on a.订单ID =b.订单ID