View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 3,901–3,925 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 4133 | 2017-10-26 | 2017-10-26 12:30:32 | 1 | Bus |
| 4135 | 2017-10-26 | 2017-10-26 12:29:33 | 1 | Bus |
| 4136 | 2017-10-26 | 2017-10-26 12:32:28 | 1 | Bus |
| 4137 | 2017-10-26 | 2017-10-26 12:29:47 | 1 | Bus |
| 4138 | 2017-10-26 | 2017-10-26 12:30:46 | 1 | Bus |
| 4140 | 2017-07-06 | 2017-07-06 15:08:54 | 4 | Metro |
| 4141 | 2017-07-06 | 2017-07-06 15:08:52 | 4 | Metro |
| 4142 | 2017-06-30 | 2017-06-30 14:32:04 | 2 | Metro |
| 4143 | 2017-06-30 | 2017-06-30 14:32:20 | 2 | Metro |
| 4144 | 2017-07-05 | 2017-07-05 10:38:56 | 2 | Metro |
| 4145 | 2017-07-05 | 2017-07-05 10:38:48 | 2 | Metro |
| 4146 | 2017-07-05 | 2017-07-05 10:39:04 | 2 | Metro |
| 4147 | 2017-07-05 | 2017-07-05 10:38:54 | 2 | Metro |
| 4148 | 2017-07-06 | 2017-07-06 09:05:14 | 2 | Taxi |
| 4149 | 2017-07-06 | 2017-07-06 09:05:16 | 2 | Taxi |
| 4150 | 2017-07-01 | 2017-07-01 12:57:25 | 1 | Metro |
| 4151 | 2017-07-01 | 2017-07-01 12:57:55 | 1 | Metro |
| 4152 | 2017-07-01 | 2017-07-01 12:57:37 | 1 | Metro |
| 4153 | 2017-07-01 | 2017-07-01 12:57:33 | 1 | Metro |
| 4154 | 2017-07-01 | 2017-07-01 09:22:52 | 1 | Bus |
| 4155 | 2017-07-01 | 2017-07-01 09:22:53 | 1 | Bus |
| 4156 | 2017-07-01 | 2017-07-01 09:23:09 | 1 | Bus |
| 4157 | 2017-07-01 | 2017-07-01 09:23:01 | 1 | Bus |
| 4158 | 2017-07-01 | 2017-07-01 12:41:53 | 5 | Walk |
| 4159 | 2017-07-01 | 2017-07-01 12:41:21 | 5 | Walk |
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;