I have this select: Can it be written in sqlite_orm? In particular how can we deal with ifnull function?
SELECT c.*, IFNULL(i.response_1_count, 0) AS response_1_count
FROM Claims c
LEFT JOIN
(
SELECT fkey_claim, COUNT(*) AS response_1_count
FROM Invoices
WHERE fkey_INSResponse = 1
GROUP BY fkey_claim
) AS i
ON i.fkey_claim = c.id_claim
I have this select: Can it be written in sqlite_orm? In particular how can we deal with ifnull function?