Can I to do this query with Prisma function

Viewed 23

is it possible to do this query

SELECT 
    a.color, a.is_active
FROM
    tableName a
        INNER JOIN
    (SELECT 
        color, COUNT(*) totalCount
    FROM
        tableName
    GROUP BY color) b ON a.color = b.color
WHERE
    a.is_active
ORDER BY b.totalCount DESC;

With a findMany prisma function, not using a query raw.

Thanks

0 Answers
Related