View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 2,051–2,075 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 2167 | 2016-05-29 | 2016-05-29 12:03:02 | 4 | Bus |
| 2168 | 2016-05-29 | 2016-05-29 12:01:45 | 4 | Bus |
| 2169 | 2016-05-29 | 2016-05-29 12:00:56 | 4 | Bus |
| 2170 | 2016-05-29 | 2016-05-29 12:02:41 | 4 | Bus |
| 2171 | 2016-05-29 | 2016-05-29 12:04:15 | 4 | Bus |
| 2172 | 2016-05-29 | 2016-05-29 12:01:11 | 4 | Bus |
| 2174 | 2016-05-29 | 2016-05-29 12:02:02 | 4 | Bus |
| 2175 | 2016-05-29 | 2016-05-29 12:02:57 | 4 | Bus |
| 2176 | 2016-05-29 | 2016-05-29 12:01:26 | 4 | Bus |
| 2178 | 2016-05-29 | 2016-05-29 12:05:25 | 4 | Bus |
| 2179 | 2016-05-29 | 2016-05-29 12:06:06 | 4 | Bus |
| 2180 | 2016-05-29 | 2016-05-29 12:05:25 | 4 | Bus |
| 2182 | 2016-05-29 | 2016-05-29 12:04:40 | 4 | Bus |
| 2183 | 2016-05-29 | 2016-05-29 12:05:51 | 4 | Bus |
| 2184 | 2016-05-29 | 2016-05-29 12:03:29 | 4 | Bus |
| 2185 | 2016-05-29 | 2016-05-29 12:05:45 | 4 | Bus |
| 2187 | 2016-05-29 | 2016-05-29 12:02:39 | 4 | Bus |
| 2188 | 2016-05-29 | 2016-05-29 12:04:27 | 4 | Bus |
| 2189 | 2016-05-29 | 2016-05-29 12:05:46 | 4 | Bus |
| 2190 | 2016-05-29 | 2016-05-29 12:07:09 | 4 | Bus |
| 2191 | 2016-05-29 | 2016-05-29 12:05:31 | 4 | Bus |
| 2192 | 2016-05-29 | 2016-05-29 12:01:53 | 4 | Bus |
| 2194 | 2016-05-29 | 2016-05-29 12:04:33 | 4 | Bus |
| 2196 | 2016-05-29 | 2016-05-29 12:08:41 | 4 | Bus |
| 2197 | 2016-05-29 | 2016-05-29 12:08:14 | 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;