View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 8,501–8,525 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 8928 | 2019-11-05 | 2019-11-05 10:02:42 | 1 | Bus |
| 8929 | 2019-11-05 | 2019-11-05 10:01:47 | 1 | Bus |
| 8930 | 2019-11-05 | 2019-11-05 10:00:23 | 1 | Bus |
| 8931 | 2019-11-05 | 2019-11-05 10:01:39 | 1 | Bus |
| 8932 | 2019-11-05 | 2019-11-05 10:02:11 | 1 | Bus |
| 8935 | 2019-11-05 | 2019-11-05 10:01:27 | 1 | Bus |
| 8936 | 2019-11-05 | 2019-11-05 10:02:54 | 1 | Bus |
| 8937 | 2019-11-05 | 2019-11-05 10:01:39 | 1 | Bus |
| 8938 | 2019-11-05 | 2019-11-05 10:02:43 | 1 | Bus |
| 8941 | 2019-11-05 | 2019-11-05 10:00:51 | 1 | Bus |
| 8942 | 2019-11-05 | 2019-11-05 10:05:34 | 1 | Bus |
| 8943 | 2019-11-05 | 2019-11-05 10:02:35 | 1 | Bus |
| 8944 | 2019-11-05 | 2019-11-05 10:06:00 | 1 | Bus |
| 8945 | 2019-11-05 | 2019-11-05 10:03:57 | 1 | Bus |
| 8946 | 2019-11-05 | 2019-11-05 10:02:21 | 1 | Bus |
| 8947 | 2019-11-05 | 2019-11-05 10:03:03 | 1 | Bus |
| 8948 | 2019-09-15 | 2019-09-15 11:53:44 | 1 | Metro |
| 8949 | 2019-09-12 | 2019-09-12 10:12:38 | 1 | Walk |
| 8950 | 2019-09-14 | 2019-09-14 09:10:08 | 1 | Metro |
| 8951 | 2019-09-14 | 2019-09-14 14:38:32 | 2 | Metro |
| 8952 | 2019-09-14 | 2019-09-14 14:38:15 | 2 | Metro |
| 8953 | 2019-09-13 | 2019-09-13 11:22:51 | 1 | Walk |
| 8954 | 2019-09-13 | 2019-09-13 11:22:56 | 1 | Walk |
| 8955 | 2019-09-13 | 2019-09-13 11:22:43 | 1 | Walk |
| 8956 | 2019-09-11 | 2019-09-11 10:40:35 | 2 | Metro |
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;