openvk/Web/Models/sql/get-correspondencies-count.tsql
veselcraft db3789bef8
Messages: Redesign, Date fix, Pagination
Search: Kind of fix by adding more shitcode xdddddd

Co-authored-by: Daniel <60743585+myslivets@users.noreply.github.com>
2022-05-31 17:39:52 +03:00

20 lines
No EOL
305 B
Text

SELECT COUNT(id) AS cnt FROM
(
(
SELECT
recipient_id AS id
FROM messages
WHERE
sender_id = ?
AND
sender_type = ?
) UNION (
SELECT
sender_id AS id
FROM messages
WHERE
recipient_id = ?
AND
recipient_type = ?
)
) dt