So I have received this error: #1066 - Not unique table/alias: 'Purchase'
I am trying to do the following:
SELECT Blank.BlankTypeCode
,Blank.BlankCode
,Payment.Amount
,Payment.Type
,Purchase.PurchaseDate
,Payment.DatePaid
FROM Blank
INNER JOIN Ticket
ON Blank.BlankCode = Ticket.Blank_BlankCode
INNER JOIN MCO_Blank
ON Blank.BlankCode = MCO_Blank.Blank_BlankCode
INNER JOIN Purchase
ON Ticket.PurchaseID = Purchase.PurchaseID
INNER JOIN Purchase
ON MCO_Blank.PurchaseID = Purchase.PurchaseID
INNER JOIN Payment
ON Ticket.PurchaseID = Payment.PurchaseID
INNER JOIN Payment
ON MCO_Blank.PurchaseID = Payment.PurchaseID
WHERE Payment.Status = "Paid";
Blank Table consists of:
BlankCode,
IssueDate,
Status,
UserID,
BlankTypeCode
Payment Table consists of:
Type,
Amount,
Status,
DueDate,
PurchaseID,
CurrencyRateDate
Purchase Table consists of:
PurchaseID,
CustomerID,
PurchaseDate,
TotalFare,
TaxAmount,
CurrencyType,
Purchasecol
Ticket Table consists of:
Price,
PurchaseID,
Blank_BlankCode,
Blank_BlankTypeCode,
TicketType,
Airline_Name
MCO_Blank Table consists of:
Service,
Cost,
Description,
Purchase_PurchaseID,
Blank_BlankCode,
Blank_BlankTypeCode
I am unsure of how I can make this work.
See Question&Answers more detail:
os