Created
August 7, 2018 12:37
-
-
Save Unison1/47685914acaff2e040323b4842b6cb03 to your computer and use it in GitHub Desktop.
SQLite script for searching messages in the database Viber
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 par_inf.number AS [Номер],par_inf.contact_name AS [Имя],mes.body AS [Сообщение], | |
DATETIME(SUBSTR(mes.msg_date , 1,10), 'unixepoch', 'localtime') AS [Дата]/*так как в ячейке mes.msg_date содержется дата и время в секундах, преобразуем его в | |
читабельный формат и выбор времени для текущей локации */ | |
FROM conversations AS con | |
JOIN messages AS mes ON con._id = mes.conversation_id | |
JOIN participants AS par ON par.conversation_id = con._id | |
JOIN participants_info AS par_inf ON par.participant_info_id = par_inf._id | |
WHERE par_inf.number = '*************'-- фильтруем таблицу по номеру | |
ORDER BY mes.msg_date DESC--устанавливает порядок сортирования по убыванию, от больших значений к меньшим | |
------------------------------------------------------------------------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment