Skip to content

what is the sqlite_orm equivalent to ifnull(X,Y) ? #715

@juandent

Description

@juandent

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions