私は次のクエリを持っています:
SELECT item.`ID`, item.`Name`, item.`UnitCost`,
item.`Price`, discount.`rate`
FROM item
INNER JOIN discount ON discount.`ID`=item.`DiscountID`
WHERE item.`Code`=itemCode;
discount
が(MEANS NULL)に割り当てられていない場合item
、上記のクエリは行を返しません。
クエリを変更して処理するにはどうすればよいnull
ですか?の場合、null
0item.discountID
を返す必要がありますか?