I have added LIMIT 3
in below code to display 3 results of a JOINED table. However in Python multiple lines was displayed. In SQL execution, it is fine.
Please advise what is the reason? THanks
lib = cur.execute('''SELECT Track.title, Artist.name, Album.title, Genre.name
FROM Track JOIN Genre JOIN Album JOIN Artist
ON Track.genre_id = Genre.ID AND Track.album_id = Album.id
AND Album.artist_id = Artist.id
ORDER BY Artist.name LIMIT 3''')
for row in lib:
print(row)