Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Отберите десять самых коротких по продолжительности треков и выгрузите названия их жанров.
- SELECT name
- FROM genre
- WHERE genre_id IN
- (SELECT DISTINCT(genre_id)
- FROM
- (SELECT genre_id
- FROM track
- ORDER BY milliseconds
- LIMIT 10) AS sub);
Advertisement
Comments
-
- необходимо добавить псевдонимы
- SELECT g.name
- FROM genre AS g
- JOIN track AS t ON g.genre_id = t.genre_id
- WHERE t.track_id IN
- (SELECT track_id
- FROM track
- ORDER BY milliseconds
- LIMIT 2)
- ORDER BY t.milliseconds;
Add Comment
Please, Sign In to add comment
Advertisement