无法创建简单的MySQL查询作为视图

时间:2018-12-18 07:35:38

标签: mysql sql mariadb

我正在尝试将此简单查询放入视图。该查询可以像其自己的查询一样正常运行,但是在尝试将其创建到视图中时出现以下错误:

#1060 - Duplicate column name 'track_id'

查询:

CREATE VIEW `Spotify_History` AS 
SELECT * FROM Play_History 
LEFT JOIN Track ON Play_History.track_id = Track.track_id
LEFT JOIN Album ON Play_History.album_id = Album.album_id
LEFT JOIN Artist ON Play_History.artist_id = Artist.artist_id
LEFT JOIN Device ON Play_History.device_id = Device.device_id

0 个答案:

没有答案