View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 2,951–2,975 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 3109 | 2017-02-24 | 2017-02-24 11:02:57 | 4 | Bus |
| 3110 | 2017-02-24 | 2017-02-24 11:05:30 | 4 | Bus |
| 3111 | 2017-02-24 | 2017-02-24 11:05:13 | 4 | Bus |
| 3112 | 2017-02-24 | 2017-02-24 11:03:52 | 4 | Bus |
| 3113 | 2017-02-24 | 2017-02-24 11:06:41 | 4 | Bus |
| 3114 | 2017-02-24 | 2017-02-24 11:04:43 | 4 | Bus |
| 3115 | 2017-02-24 | 2017-02-24 11:04:19 | 4 | Bus |
| 3116 | 2017-02-24 | 2017-02-24 11:02:08 | 4 | Bus |
| 3117 | 2017-02-24 | 2017-02-24 11:02:49 | 4 | Bus |
| 3118 | 2017-02-24 | 2017-02-24 11:06:00 | 4 | Bus |
| 3119 | 2017-02-24 | 2017-02-24 11:02:23 | 4 | Bus |
| 3120 | 2017-02-24 | 2017-02-24 11:05:04 | 4 | Bus |
| 3121 | 2017-02-24 | 2017-02-24 11:06:33 | 4 | Bus |
| 3122 | 2017-02-24 | 2017-02-24 11:09:28 | 4 | Bus |
| 3123 | 2017-02-24 | 2017-02-24 11:05:31 | 4 | Bus |
| 3124 | 2017-02-24 | 2017-02-24 11:07:49 | 4 | Bus |
| 3125 | 2017-02-24 | 2017-02-24 11:02:09 | 4 | Bus |
| 3126 | 2017-02-24 | 2017-02-24 11:09:43 | 4 | Bus |
| 3127 | 2017-02-24 | 2017-02-24 11:07:39 | 4 | Bus |
| 3128 | 2017-02-24 | 2017-02-24 11:02:21 | 4 | Bus |
| 3129 | 2017-02-24 | 2017-02-24 11:03:13 | 4 | Bus |
| 3130 | 2017-02-24 | 2017-02-24 11:05:45 | 4 | Bus |
| 3131 | 2017-02-24 | 2017-02-24 11:04:13 | 4 | Bus |
| 3132 | 2017-02-24 | 2017-02-24 11:05:10 | 4 | Bus |
| 3133 | 2017-02-24 | 2017-02-24 11:04:25 | 4 | 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;