How do I output the duplicates with a certain pk in postgre?
There is a table. Need from a web muzzle Django to pass volumio_id. For example volumio_id=[6,7, 2] and shows me the total record for these ajtishnikam. In this case name= "11_You_Wish.mp3". You need to look at the name.
Need help constructing a query that I could pass ajtishniki, and in response received a total song. Or how to do it through the Djano ORM
Mariana_Schaefer answered on March 23rd 20 at 19:40
SELECT 1 as id, volo_files.name, string_agg(CAST(volo_files.volumio_id AS TEXT), ', ') AS volumio_ids, count(volo_files.name) as cnt
where volumio_id in %s
GROUP BY volo_files.name
HAVING count(volo_files.name) > 1