View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 2,251–2,275 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 2386 | 2016-06-28 | 2016-06-28 12:57:33 | 1 | Metro |
| 2387 | 2016-06-18 | 2016-06-18 11:55:34 | 2 | Private Vehicle |
| 2388 | 2016-06-18 | 2016-06-18 11:55:44 | 2 | Private Vehicle |
| 2389 | 2016-06-18 | 2016-06-18 11:55:14 | 2 | Private Vehicle |
| 2390 | 2016-06-29 | 2016-06-29 14:11:39 | 2 | Walk |
| 2391 | 2016-06-19 | 2016-06-19 14:27:52 | 1 | Taxi |
| 2392 | 2016-06-19 | 2016-06-19 14:27:55 | 1 | Taxi |
| 2393 | 2016-06-20 | 2016-06-20 10:36:04 | 2 | Taxi |
| 2394 | 2016-06-20 | 2016-06-20 10:35:45 | 2 | Taxi |
| 2395 | 2016-06-20 | 2016-06-20 10:36:25 | 2 | Taxi |
| 2396 | 2016-07-07 | 2016-07-07 10:25:27 | 1 | Walk |
| 2397 | 2016-07-01 | 2016-07-01 12:58:24 | 2 | Metro |
| 2398 | 2016-06-23 | 2016-06-23 13:35:35 | 2 | Metro |
| 2399 | 2016-06-23 | 2016-06-23 13:35:32 | 2 | Metro |
| 2400 | 2016-06-23 | 2016-06-23 13:35:52 | 2 | Metro |
| 2401 | 2016-07-02 | 2016-07-02 10:03:46 | 1 | Bus |
| 2402 | 2016-07-02 | 2016-07-02 10:03:30 | 1 | Bus |
| 2403 | 2016-07-02 | 2016-07-02 10:03:20 | 1 | Bus |
| 2404 | 2016-07-02 | 2016-07-02 10:03:48 | 1 | Bus |
| 2405 | 2016-06-24 | 2016-06-24 13:17:43 | 1 | Walk |
| 2406 | 2016-06-24 | 2016-06-24 10:09:12 | 1 | Other |
| 2407 | 2016-06-24 | 2016-06-24 13:48:25 | 2 | Private Vehicle |
| 2408 | 2016-06-24 | 2016-06-24 13:48:11 | 2 | Private Vehicle |
| 2409 | 2016-06-25 | 2016-06-25 13:39:44 | 1 | Walk |
| 2410 | 2016-06-25 | 2016-06-25 14:11:17 | 1 | Train |
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;