View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 1,976–2,000 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 2087 | 2016-04-26 | 2016-04-26 09:09:47 | 1 | Walk |
| 2088 | 2016-04-26 | 2016-04-26 09:09:24 | 1 | Walk |
| 2089 | 2016-04-26 | 2016-04-26 16:44:04 | 5 | Walk |
| 2090 | 2016-05-01 | 2016-05-01 13:04:25 | 1 | Bus |
| 2091 | 2016-05-01 | 2016-05-01 13:04:03 | 1 | Bus |
| 2092 | 2016-05-01 | 2016-05-01 13:04:13 | 1 | Bus |
| 2093 | 2016-05-17 | 2016-05-17 13:22:14 | 2 | Walk |
| 2094 | 2016-05-17 | 2016-05-17 13:21:36 | 2 | Walk |
| 2095 | 2016-05-17 | 2016-05-17 13:21:29 | 2 | Walk |
| 2096 | 2016-05-02 | 2016-05-02 09:51:55 | 2 | Private Vehicle |
| 2097 | 2016-05-02 | 2016-05-02 09:52:00 | 2 | Private Vehicle |
| 2098 | 2016-05-02 | 2016-05-02 09:51:47 | 2 | Private Vehicle |
| 2099 | 2016-05-02 | 2016-05-02 09:52:10 | 2 | Private Vehicle |
| 2100 | 2016-04-30 | 2016-04-30 16:25:22 | 2 | Metro |
| 2101 | 2016-04-30 | 2016-04-30 16:25:26 | 2 | Metro |
| 2102 | 2016-04-30 | 2016-04-30 16:25:31 | 2 | Metro |
| 2103 | 2016-04-30 | 2016-04-30 16:25:22 | 2 | Metro |
| 2104 | 2016-04-30 | 2016-04-30 16:25:35 | 2 | Metro |
| 2105 | 2016-04-30 | 2016-04-30 11:45:36 | 1 | Private Vehicle |
| 2106 | 2016-04-30 | 2016-04-30 11:45:43 | 1 | Private Vehicle |
| 2107 | 2016-04-30 | 2016-04-30 11:45:45 | 1 | Private Vehicle |
| 2108 | 2016-05-07 | 2016-05-07 12:36:59 | 1 | Walk |
| 2109 | 2016-05-07 | 2016-05-07 12:36:25 | 1 | Walk |
| 2110 | 2016-05-07 | 2016-05-07 12:37:02 | 1 | Walk |
| 2111 | 2016-05-07 | 2016-05-07 14:10:49 | 1 | Metro |
View definition
CREATE VIEW museum_visit AS
SELECT
e.ticket_id,
date(e.scanned_at) AS visit_date,
e.scanned_at AS first_entry_at,
e.entrance_id,
e.transport_mode
FROM entry_scan e
WHERE e.is_first_entry = 1;