gpt4 book ai didi

mysql查询返回空行

转载 作者:太空宇宙 更新时间:2023-11-03 11:52:48 24 4
gpt4 key购买 nike

<分区>

我想执行这个查询,但是当表为空时它返回空行。它在 SUM(products.sale_price)/COUNT(orders.id) AS avg_price_rang 时工作
不在查询中

SELECT
products.brand_id,
(SELECT
category_brands.name
FROM
category_brands
WHERE
category_brands.id=products.brand_id
) AS brand,
products.material_id,
(SELECT
category_materials.material
FROM
category_materials
WHERE
category_materials.id=products.material_id
) AS material,
orders.color_code,
SUM(products.sale_price)/COUNT(orders.id) AS avg_price_rang
FROM
orders
INNER JOIN
products
ON
orders.prodcut_id = products.id

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com