Created
April 29, 2021 06:52
-
-
Save bryanjhv/f4164993595db92a28c2568338e60ee0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
-- Get SMS summary from Gammu SMSD | |
-- from almost all content tables. | |
CREATE VIEW summary | |
AS | |
( | |
SELECT | |
'inbox' AS kind, | |
ID AS id, | |
ReceivingDateTime AS created, | |
UpdatedInDB AS updated, | |
SenderNumber AS number, | |
TextDecoded AS content, | |
Status AS status | |
FROM inbox | |
) | |
UNION ALL | |
( | |
SELECT | |
'outbox' AS kind, | |
ID AS id, | |
SendingDateTime AS created, | |
UpdatedInDB AS updated, | |
DestinationNumber AS number, | |
TextDecoded AS content, | |
Status AS status | |
FROM outbox | |
) | |
UNION ALL | |
( | |
SELECT | |
'sentitems' AS kind, | |
ID AS id, | |
SendingDateTime AS created, | |
UpdatedInDB AS updated, | |
DestinationNumber AS number, | |
TextDecoded AS content, | |
Status AS status | |
FROM sentitems | |
) | |
ORDER BY | |
created, | |
updated | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment