Last active
January 22, 2019 13:04
-
-
Save Unison1/1e338fcdadf4d2e9bde04f18d12ac83f to your computer and use it in GitHub Desktop.
WhatsApp_search_for_msgstore.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM (SELECT CASE mes.key_from_me | |
WHEN "1" THEN 'Сообщение пользователя' | |
WHEN "0" THEN 'Сообщение контакта' | |
END AS [Источник сообщения], | |
SUBSTR(mes.key_remote_jid, 1,12) AS [Контакт], data, | |
DATETIME(SUBSTR(mes.timestamp , 1,10), 'unixepoch', 'localtime') AS [Дата], media_caption AS [Подпись к медиа файлам], | |
mes.media_hash, NULL AS [Hex] | |
FROM messages mes | |
LEFT JOIN missed_call_logs mcl ON mes._id = mcl.message_row_id | |
WHERE mcl._id IS Null AND mes.key_id NOT LIKE 'call:%' | |
UNION ALL | |
SELECT CASE mes.key_from_me | |
WHEN "1" THEN 'Сообщение пользователя' | |
WHEN "0" THEN 'Сообщение контакта' | |
END AS [Источник сообщения], | |
SUBSTR(mes.key_remote_jid, 1,12) AS [Контакт], data, | |
DATETIME(SUBSTR(mes.timestamp , 1,10), 'unixepoch', 'localtime') AS [Дата], media_caption AS [Подпись к медиа файлам], | |
mes.media_hash, mes_t.thumbnail AS [Hex] | |
FROM messages mes | |
JOIN message_thumbnails mes_t ON mes.key_id = mes_t.key_id | |
) | |
WHERE Контакт = '380*********' | |
GROUP BY [Дата],[Подпись к медиа файлам], media_hash | |
ORDER BY Дата ASC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment