CREATE VIEW CustomerInterestsView AS
SELECT LastName AS CustomerLastName,
C.FirstName AS CustomerFirstName,
A.LastName AS ArtistName
FROM
CUSTOMER AS C
JOIN
CUSTOMER_ARTIST_INT AS CAI ON C.CustomerID = CAI.CustomerID
JOIN
ARTIST AS A ON CAI.ArtistID = A.ArtistID;
1条答案
按热度按时间rpppsulh1#
改变
SELECT LastName
至SELECT C.LastName
.两个
CUSTOMER
以及ARTIST
表有一个LastName
列。不清楚这两个是哪一个LastName
您所指的列,因此LastName
列不明确”。在它前面加上表别名
C
,您指定要LastName
从CUSTOMERS
table。