我敢肯定这个问题之前已经回答过,但我找不到!
表 - 预订 B
Customer Product
Tim Milk
Bob Milk
表 - 产品 P
Customer Product Description
Tim Milk This is Tim's Milk
NULL Milk This is Anybody's Milk
我想加入表格并获得以下输出(为简单起见,显示示例中的所有列):
B.Customer B.Product P.Customer P.Product P.Description
Tim MILK Tim MILK This is Tim's Milk
Bob MILK NULL MILK This is Anybody's Milk
所以,查询应该首先查找是否有特定的客户相关产品,如果有,使用它,否则使用通用产品......
非常感激!