我有 2 个选择语句。
1- select sm.id, IFNULL(sm.unit_price,0) as unit_price
from crm_stock_manager sm
left join crm_purchase_order_items poi on poi.id = sm.purchase_order_item_id and poi.is_del = 0
left join crm_products p on poi.product_id = p.id and p.is_del = 0
where sm.is_del = 0 and IFNULL(sm.unit_price, '') != '' and p.id = 253 order by sm.created_on;
2- select 0 as id ,price as unit_price from crm_products where id = 253 and is_del=0;
如果第一个选择语句返回一个空结果,那么我想运行第二个选择语句。
请帮我。