Please help to make the request.
There are two tables, artist and album.
I want to select only those artists whose albums contains a picture.
That is, if the actor has 10 albums and only one of them has a picture or does not contain, i want to skip (only if all albums artist has pictures)
table artist:
artist_id
---------|
1 |
2 |
table albums:
artist_id | album_id | picture_id
---------------------------------
1 | 122... | true
1 | 123... | false
2 | 124... | true
2 | 125... | true
So, I want to select only artist where artist_id=2 (because all the albums have pictures);
there are a lot of solutions for this, the first that comes to my mind is a very simple sub-select to exclude the artists that have an album without an image:
EDIT:
if you have stored artists without albums, these have to be excluded, too (take a look at the comments for explanation). in that case, you’ll have to add something like: