View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 3,051–3,075 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 3222 | 2017-04-06 | 2017-04-06 13:20:04 | 1 | Bus |
| 3223 | 2017-04-06 | 2017-04-06 13:17:38 | 1 | Bus |
| 3224 | 2017-04-06 | 2017-04-06 13:19:30 | 1 | Bus |
| 3225 | 2017-04-06 | 2017-04-06 13:19:38 | 1 | Bus |
| 3226 | 2017-04-06 | 2017-04-06 13:18:19 | 1 | Bus |
| 3227 | 2017-04-06 | 2017-04-06 13:21:54 | 1 | Bus |
| 3228 | 2017-04-06 | 2017-04-06 13:23:08 | 1 | Bus |
| 3229 | 2017-04-06 | 2017-04-06 13:19:06 | 1 | Bus |
| 3230 | 2017-04-06 | 2017-04-06 13:21:57 | 1 | Bus |
| 3231 | 2017-04-06 | 2017-04-06 13:24:24 | 1 | Bus |
| 3234 | 2017-04-06 | 2017-04-06 13:19:24 | 1 | Bus |
| 3238 | 2017-04-06 | 2017-04-06 13:21:54 | 1 | Bus |
| 3239 | 2016-12-19 | 2016-12-19 13:30:27 | 5 | Walk |
| 3242 | 2016-12-23 | 2016-12-23 09:31:11 | 1 | Walk |
| 3243 | 2016-12-23 | 2016-12-23 09:30:34 | 1 | Walk |
| 3244 | 2016-12-23 | 2016-12-23 14:26:53 | 1 | Train |
| 3245 | 2016-12-23 | 2016-12-23 14:27:31 | 1 | Train |
| 3246 | 2016-12-23 | 2016-12-23 14:27:26 | 1 | Train |
| 3247 | 2016-12-23 | 2016-12-23 14:27:17 | 1 | Train |
| 3248 | 2017-01-05 | 2017-01-05 09:37:18 | 1 | Private Vehicle |
| 3249 | 2017-01-05 | 2017-01-05 09:37:24 | 1 | Private Vehicle |
| 3250 | 2017-01-05 | 2017-01-05 09:37:17 | 1 | Private Vehicle |
| 3251 | 2016-12-24 | 2016-12-24 10:24:52 | 5 | Walk |
| 3252 | 2016-12-24 | 2016-12-24 10:24:50 | 5 | Walk |
| 3253 | 2017-03-15 | 2017-03-15 11:20:50 | 4 | 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;