我有一个名为“customer_requests”的表:
[CustomerRequestID]
[Title]
[Description]
[RFQDate]
[Q2CDate]
[QuantityRequested]
[GST]
[NetCost]
[Markup]
[NetSellPrice]
[GrossSellPrice]
[fkCustomerID]
[Status]
还有一张名为“job”的表格:
[JobID]
[JobTitle]
[Description]
[fkCustomerRequestID]
[fkSupplierID]
[fkSupplierQuoteID]
[Quantity]
[Cost]
[Status]
[ETA]
[LoggedBy]
[DeliveryAddress]
[ParentJobID]
我想编写一个选择查询,从两个表中选择所有条目,并将它们显示在下表中:
[QuoteNumber] (refers to CustomerRequestID in customer_requests, and fkCustomerRequestID in job)
[JobNumber] (refers to JobID in job, and is blank if the entry is from customer_requests)
[CustomerName] (selected using fkCustomerID in customer_requests, selected using fkCustomerRequestID->fkCustomerID in job)
[SupplierName] (selected using fkSupplierID in job, blank if entry is from customer_requests)
[JobTitle] (refers to title in customer_requests, and JobTitle in job)
[Quantity] (refers to QuantityRequested in customer_requests, and Quantity in Job)
[Cost] (refers to GrossSellPrice in customer_requests and Cost in Job)
[ETA] (refers to ETA in Job, and blank if the entry is from customer_requests)
[Status] (refers to Status in customer_requests, and Status in Job)
我如何将这两者结合在一起来制作这张桌子?