加入2个表后可以添加AND吗?

时间:2013-01-02 14:35:25

标签: mysql join

这是合法的MySql查询吗? (更确切地说,我加入2个表并添加AND条件的部分。)

LEFT JOIN release_artwork ON release_artwork.album_id = album.album_id AND release_artwork.position = 1

以下是完整的查询:

SELECT album.album_id, album.title, country.country_id, artwork.thumb_filename, artwork.thumb_width, artwork.thumb_height
FROM song
JOIN album ON song.published_album = album.album_id
LEFT JOIN country ON album.country_id = country.country_id
LEFT JOIN release_artwork ON release_artwork.release_id = album.album_id AND release_artwork.position = 1
LEFT JOIN artwork ON artwork.artwork_id = release_artwork.artwork_id
WHERE song.song_id = 1

我可以在加入2个表后立即添加AND吗?

1 个答案:

答案 0 :(得分:1)

完全合法。我不认为它会抛出任何错误