View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 4,626–4,650 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 4882 | 2017-11-23 | 2017-11-23 12:21:57 | 2 | Walk |
| 4883 | 2017-11-23 | 2017-11-23 12:21:19 | 2 | Walk |
| 4884 | 2017-11-23 | 2017-11-23 12:21:53 | 2 | Walk |
| 4885 | 2017-11-23 | 2017-11-23 14:39:41 | 2 | Metro |
| 4886 | 2017-11-23 | 2017-11-23 14:39:32 | 2 | Metro |
| 4887 | 2017-11-23 | 2017-11-23 16:28:25 | 1 | Bus |
| 4888 | 2017-12-13 | 2017-12-13 10:20:42 | 2 | Train |
| 4889 | 2017-12-13 | 2017-12-13 10:20:39 | 2 | Train |
| 4890 | 2017-11-25 | 2017-11-25 12:47:28 | 2 | Metro |
| 4891 | 2017-11-25 | 2017-11-25 12:47:21 | 2 | Metro |
| 4892 | 2017-12-14 | 2017-12-14 10:22:21 | 2 | Metro |
| 4893 | 2017-11-26 | 2017-11-26 10:35:22 | 1 | Metro |
| 4894 | 2017-11-26 | 2017-11-26 10:35:15 | 1 | Metro |
| 4895 | 2017-11-26 | 2017-11-26 14:28:39 | 4 | Private Vehicle |
| 4896 | 2017-11-26 | 2017-11-26 14:28:35 | 4 | Private Vehicle |
| 4897 | 2017-11-26 | 2017-11-26 15:48:39 | 5 | Walk |
| 4898 | 2017-11-28 | 2017-11-28 12:20:40 | 1 | Private Vehicle |
| 4899 | 2017-11-28 | 2017-11-28 12:21:01 | 1 | Private Vehicle |
| 4900 | 2017-11-28 | 2017-11-28 14:18:58 | 2 | Metro |
| 4901 | 2017-11-29 | 2017-11-29 13:26:02 | 2 | Metro |
| 4902 | 2017-12-01 | 2017-12-01 11:51:22 | 1 | Metro |
| 4903 | 2017-12-01 | 2017-12-01 11:51:32 | 1 | Metro |
| 4904 | 2017-12-01 | 2017-12-01 11:51:39 | 1 | Metro |
| 4905 | 2017-12-01 | 2017-12-01 11:51:57 | 1 | Metro |
| 4906 | 2017-12-10 | 2017-12-10 10:54:03 | 1 | 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;