mirror of
https://github.com/openvk/openvk
synced 2024-11-14 19:19:14 +03:00
25 lines
378 B
Text
25 lines
378 B
Text
|
SELECT
|
||
|
*
|
||
|
FROM
|
||
|
`messages`
|
||
|
WHERE
|
||
|
(`deleted` = 0)
|
||
|
AND (`id` < ?)
|
||
|
AND (
|
||
|
(
|
||
|
(`sender_type` = ?)
|
||
|
AND (`recipient_type` = ?)
|
||
|
AND (`sender_id` = ?)
|
||
|
AND (`recipient_id` = ?)
|
||
|
)
|
||
|
OR (
|
||
|
(`sender_type` = ?)
|
||
|
AND (`recipient_type` = ?)
|
||
|
AND (`sender_id` = ?)
|
||
|
AND (`recipient_id` = ?)
|
||
|
)
|
||
|
)
|
||
|
ORDER BY
|
||
|
`created` DESC
|
||
|
LIMIT
|
||
|
?
|