我有 3 张桌子:
追踪:
id, title, artist_id, album_id, description, cover
艺术家:
id, name, bio
专辑:
id, title, description, artist_id, cover
我实际上有这个要求:
SELECT * FROM `track`
LEFT JOIN album ON track.album_id=album.id
LEFT JOIN artist ON album.artist_id=artist.id
但是,如果曲目没有专辑,我怎么能track.album_id = 0
加入那个条件来获得艺术家信息?LEFT JOIN artist ON track.artist_id=artist.id