I’ve a query
SELECT COUNT(*) AS mock_test_count
FROM mock_test
WHERE isActive = 1
AND id NOT IN ( SELECT mock_test_id
FROM mock_tests_given_by_students
WHERE student_id = 2 )
I’m using prisma orm.
already gone through the docs of nested query in prisma, but didn’t found any solution. I can solve the query using 2 different prisma query, but I want to it in a single prisma function. Is it even possible via prisma
2
Answers
You can rewrite it without a subquery: