View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 9,351–9,375 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 9807 | 2020-02-24 | 2020-02-24 11:57:11 | 1 | Bus |
| 9808 | 2020-02-24 | 2020-02-24 11:56:55 | 1 | Bus |
| 9809 | 2020-02-24 | 2020-02-24 11:56:41 | 1 | Bus |
| 9810 | 2020-02-24 | 2020-02-24 11:56:42 | 1 | Bus |
| 9811 | 2020-02-17 | 2020-02-17 12:03:16 | 2 | Train |
| 9812 | 2020-02-18 | 2020-02-18 14:00:02 | 1 | Taxi |
| 9813 | 2020-02-16 | 2020-02-16 15:17:45 | 3 | Metro |
| 9814 | 2020-02-17 | 2020-02-17 09:15:43 | 1 | Metro |
| 9815 | 2020-02-17 | 2020-02-17 09:15:47 | 1 | Metro |
| 9816 | 2020-02-17 | 2020-02-17 13:44:16 | 1 | Walk |
| 9817 | 2020-02-17 | 2020-02-17 13:44:00 | 1 | Walk |
| 9818 | 2020-02-17 | 2020-02-17 13:44:27 | 1 | Walk |
| 9819 | 2020-02-19 | 2020-02-19 12:50:22 | 1 | Train |
| 9820 | 2020-02-19 | 2020-02-19 12:49:39 | 1 | Train |
| 9821 | 2020-02-19 | 2020-02-19 12:50:23 | 1 | Train |
| 9822 | 2020-02-19 | 2020-02-19 12:49:59 | 1 | Train |
| 9823 | 2020-02-19 | 2020-02-19 12:50:16 | 1 | Train |
| 9824 | 2020-02-23 | 2020-02-23 14:42:08 | 1 | Other |
| 9825 | 2020-02-23 | 2020-02-23 14:42:45 | 1 | Other |
| 9826 | 2020-02-23 | 2020-02-23 14:42:42 | 1 | Other |
| 9827 | 2020-02-23 | 2020-02-23 14:42:30 | 1 | Other |
| 9828 | 2020-02-19 | 2020-02-19 16:33:26 | 2 | Metro |
| 9829 | 2020-02-19 | 2020-02-19 16:33:20 | 2 | Metro |
| 9830 | 2020-02-20 | 2020-02-20 10:56:31 | 4 | Walk |
| 9831 | 2020-02-22 | 2020-02-22 09:52:49 | 2 | Bus |
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;