我必須根據可以爲空的值來選擇連接列來連接。 詳細:SQL服務器條件連接
SELECT shoporders.orderid,
shopaddresses.companyname,
shopaddresses.firstname,
shopaddresses.lastname,
shopaddresses.address1,
FROM shoporders
INNER JOIN shopaddresses
ON shoporders.InvoiceAddressId = shopaddresses.addressid
where orderid = 110
order by shoporders.createddate desc
如果shoporders.InvoiceAddressId爲null,則我不得不使用shoporders.DeliveryAddressId
任何線索?
在此先感謝