mirror of
https://github.com/openvk/openvk
synced 2024-11-11 09:29:29 +03:00
20 lines
305 B
Text
20 lines
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
|