View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 7,551–7,575 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 7951 | 2019-07-14 | 2019-07-14 11:03:09 | 4 | Bus |
| 7952 | 2019-07-14 | 2019-07-14 11:03:43 | 4 | Bus |
| 7953 | 2019-07-14 | 2019-07-14 11:02:55 | 4 | Bus |
| 7954 | 2019-07-14 | 2019-07-14 11:01:17 | 4 | Bus |
| 7955 | 2019-07-14 | 2019-07-14 11:02:56 | 4 | Bus |
| 7956 | 2019-07-14 | 2019-07-14 11:04:43 | 4 | Bus |
| 7957 | 2019-07-14 | 2019-07-14 11:01:13 | 4 | Bus |
| 7958 | 2019-07-14 | 2019-07-14 11:01:19 | 4 | Bus |
| 7959 | 2019-07-14 | 2019-07-14 11:01:25 | 4 | Bus |
| 7960 | 2019-07-14 | 2019-07-14 11:02:27 | 4 | Bus |
| 7961 | 2019-07-14 | 2019-07-14 11:03:04 | 4 | Bus |
| 7962 | 2019-07-14 | 2019-07-14 11:02:43 | 4 | Bus |
| 7963 | 2019-07-14 | 2019-07-14 11:05:57 | 4 | Bus |
| 7964 | 2019-07-14 | 2019-07-14 11:04:03 | 4 | Bus |
| 7965 | 2019-07-14 | 2019-07-14 11:04:46 | 4 | Bus |
| 7966 | 2019-07-14 | 2019-07-14 11:00:59 | 4 | Bus |
| 7967 | 2019-07-14 | 2019-07-14 11:01:03 | 4 | Bus |
| 7968 | 2019-07-14 | 2019-07-14 11:07:43 | 4 | Bus |
| 7969 | 2019-07-14 | 2019-07-14 11:04:16 | 4 | Bus |
| 7970 | 2019-07-14 | 2019-07-14 11:07:35 | 4 | Bus |
| 7971 | 2019-07-14 | 2019-07-14 11:03:55 | 4 | Bus |
| 7972 | 2019-07-14 | 2019-07-14 11:04:03 | 4 | Bus |
| 7973 | 2019-04-03 | 2019-04-03 15:56:24 | 4 | Walk |
| 7974 | 2019-04-03 | 2019-04-03 15:56:05 | 4 | Walk |
| 7975 | 2019-04-11 | 2019-04-11 11:54:59 | 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;