2
我有以下查詢。如果子查詢返回空值,如何刪除一行?
select
Product.*,
(
select
group_concat(features.feature_image order by product_features.feature_order)
from product_features
inner join features
on features.id = product_features.feature_id
where
product_features.product_id = Product.id
and product_features.feature_id in(1)
) feature_image
from products as Product
where
Product.main_product_id=1
and Product.product_category_id='1'
如果feature_image爲空,我想繞過該行。
使用Where子句where feature_image <> null –