:wave: Hello! I'm entirely new to Prisma, but rela...
# orm-help
j
👋 Hello! I'm entirely new to Prisma, but relatively familiar with SQL. I'm trying to figure out how to translate my raw mysql queries to prisma. For example:
Copy code
SELECT 
    p.*, ROUND(AVG(rt.rating), 1) AS user_rating
FROM
    posts AS p
        LEFT JOIN
    ratings AS rt ON rt.entry_id = p.id
GROUP BY p.id;
I found the docs for aggregations & counts, but it doesn't seem to do what I need (I think). Do I need to create a new model to accomplish joins / selects from other tables? I did post on stack overflow earlier if slightly more context would help. Also, if there is a more appropriate place to ask newbie questions in please let me know 🙂
v
Hi @James ! Stack overflow is a good place. and thank you for announcing it here. I will reply in a moment
j
Noted & thanks a bunch!
v
@James answered, hope it helps ;)
j
Ahh this is great thanks so much!