-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
knowledgec_db.sql
39 lines (37 loc) · 1.29 KB
/
knowledgec_db.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
-- "\private\var\mobile\Library\CoreDuet\Knowledge\knowledgeC.db"
Select
ZOBJECT.z_pk,
Z_PRIMARYKEY.Z_NAME,
ZOBJECT.ZSTREAMNAME,
ZOBJECT.ZSTRING,
zobject.ZDOUBLEVALUE as 'Quantity',
zobject.ZVALUEDOUBLE as 'Value',
time (ZOBJECT.ZENDSECONDOFDAY-ZOBJECT.ZSTARTSECONDOFDAY, 'unixepoch') as 'Duration',
ZOBJECT.ZSECONDSFROMGMT/3600 as 'GMT offset',
datetime('2001-01-01', ZOBJECT.ZCREATIONDATE || ' seconds') as 'Created',
datetime('2001-01-01', ZOBJECT.ZSTARTDATE || ' seconds') as 'Started',
case ZOBJECT.ZSTARTDAYOFWEEK
when 1 then 'Sunday'
when 2 then 'Monday'
when 3 then 'Tuesday'
when 4 then 'Wednesday'
when 5 then 'Thursday'
when 6 then 'Friday'
when 7 then 'Saturday'
end as 'Start_Day',
time(ZOBJECT.ZSTARTSECONDOFDAY, 'unixepoch') as 'Start time',
datetime('2001-01-01', ZOBJECT.ZENDDATE || ' seconds') as 'Ended',
case ZOBJECT.ZENDDAYOFWEEK
when 1 then 'Sunday'
when 2 then 'Monday'
when 3 then 'Tuesday'
when 4 then 'Wednesday'
when 5 then 'Thursday'
when 6 then 'Friday'
when 7 then 'Saturday'
end as 'End_Day',
time(ZOBJECT.ZENDSECONDOFDAY, 'unixepoch') as 'End time',
ZOBJECT.zmetadata as 'Metadata(bplist)'
from zobject
join z_primarykey on z_primarykey.z_ent = zobject.z_ent
order by ZOBJECT.ZCREATIONDATE desc