View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 3,951–3,975 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 4185 | 2017-07-07 | 2017-07-07 10:27:37 | 3 | Metro |
| 4186 | 2017-07-13 | 2017-07-13 11:47:49 | 1 | Metro |
| 4187 | 2017-07-08 | 2017-07-08 11:50:57 | 1 | Walk |
| 4188 | 2017-07-08 | 2017-07-08 11:50:42 | 1 | Walk |
| 4189 | 2017-07-08 | 2017-07-08 11:50:49 | 1 | Walk |
| 4190 | 2017-07-08 | 2017-07-08 11:50:31 | 1 | Walk |
| 4191 | 2017-07-08 | 2017-07-08 11:50:34 | 1 | Walk |
| 4192 | 2017-08-04 | 2017-08-04 15:57:03 | 2 | Metro |
| 4193 | 2017-07-09 | 2017-07-09 13:44:06 | 5 | Train |
| 4194 | 2017-07-09 | 2017-07-09 13:55:12 | 3 | Metro |
| 4195 | 2017-07-09 | 2017-07-09 13:55:49 | 3 | Metro |
| 4196 | 2017-09-20 | 2017-09-20 12:32:49 | 1 | Other |
| 4197 | 2017-09-20 | 2017-09-20 12:33:04 | 1 | Other |
| 4198 | 2017-09-20 | 2017-09-20 12:33:05 | 1 | Other |
| 4199 | 2017-09-20 | 2017-09-20 12:33:19 | 1 | Other |
| 4200 | 2017-09-20 | 2017-09-20 12:33:13 | 1 | Other |
| 4201 | 2017-09-20 | 2017-09-20 12:33:49 | 1 | Other |
| 4202 | 2017-09-20 | 2017-09-20 12:33:37 | 1 | Other |
| 4203 | 2017-09-20 | 2017-09-20 12:33:24 | 1 | Other |
| 4204 | 2017-09-20 | 2017-09-20 12:34:01 | 1 | Other |
| 4205 | 2017-09-20 | 2017-09-20 12:33:25 | 1 | Other |
| 4206 | 2017-09-20 | 2017-09-20 12:34:39 | 1 | Other |
| 4207 | 2017-09-20 | 2017-09-20 12:35:23 | 1 | Other |
| 4208 | 2017-09-20 | 2017-09-20 12:34:49 | 1 | Other |
| 4209 | 2017-09-20 | 2017-09-20 12:33:41 | 1 | Other |
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;