IPB

Welcome Guest ( Log In | Register )

> foobar2000 General Forum Rules

This is NOT a tech support forum.
Tech support questions go to foobar2000 Tech Support forum instead.

See also: Hydrogenaudio Terms of Service.

 
Reply to this topicStart new topic
Filtering by grouped artist track count, Troublesome question
AnnanFay
post Apr 20 2014, 03:29
Post #1





Group: Members
Posts: 2
Joined: 20-April 14
Member No.: 115603



I'm re-rating all my music because over the years various applications and import have tagged ratings inconsistently. (also a chance to listen to stuff I've forgotten about)

I would like to view all tracks with Rating = 'p4' which have a unique artist - the artist doesn't any other tracks with rating 'p4'. That is to say, if I was using SQL I'd do something like:

SELECT * FROM tracks
WHERE rating = "p4" AND artist IN (
SELECT artist FROM tracks
WHERE rating = "p4"
GROUP BY artist
HAVING count(*) = 1
)


I'm new to foobar, no idea what I'm doing.
Go to the top of the page
+Quote Post
AnnanFay
post Apr 20 2014, 04:13
Post #2





Group: Members
Posts: 2
Joined: 20-April 14
Member No.: 115603



I found the SQL Tree component smile.gif

This seems to work if anyone comes here in the future looking for the answer:

CODE
SELECT * FROM MediaLibrary
WHERE Rating = "p4" AND "%artist%" IN (
SELECT "%artist%" FROM MediaLibrary
WHERE rating = "p4"
GROUP BY "%artist%"
HAVING count(*) = 1
)


This post has been edited by AnnanFay: Apr 20 2014, 04:14
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 30th July 2014 - 01:13