View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 4,226–4,250 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 4461 | 2017-11-06 | 2017-11-06 13:44:28 | 1 | Bus |
| 4462 | 2017-11-06 | 2017-11-06 13:43:24 | 1 | Bus |
| 4463 | 2017-11-06 | 2017-11-06 13:44:56 | 1 | Bus |
| 4464 | 2017-11-06 | 2017-11-06 13:38:20 | 1 | Bus |
| 4465 | 2017-08-21 | 2017-08-21 15:08:50 | 2 | Private Vehicle |
| 4466 | 2017-08-21 | 2017-08-21 15:09:08 | 2 | Private Vehicle |
| 4467 | 2017-09-05 | 2017-09-05 09:28:39 | 1 | Train |
| 4468 | 2017-09-05 | 2017-09-05 09:29:01 | 1 | Train |
| 4469 | 2017-08-22 | 2017-08-22 11:43:02 | 1 | Metro |
| 4470 | 2017-08-26 | 2017-08-26 15:42:30 | 1 | Bus |
| 4471 | 2017-08-22 | 2017-08-22 11:55:18 | 1 | Taxi |
| 4472 | 2017-08-22 | 2017-08-22 11:55:30 | 1 | Taxi |
| 4473 | 2017-08-22 | 2017-08-22 11:55:27 | 1 | Taxi |
| 4474 | 2017-08-22 | 2017-08-22 11:55:23 | 1 | Taxi |
| 4475 | 2017-08-22 | 2017-08-22 11:55:12 | 1 | Taxi |
| 4476 | 2017-08-22 | 2017-08-22 12:48:08 | 4 | Bus |
| 4477 | 2017-08-22 | 2017-08-22 12:47:59 | 4 | Bus |
| 4478 | 2017-08-22 | 2017-08-22 16:01:36 | 1 | Walk |
| 4479 | 2017-08-22 | 2017-08-22 16:00:59 | 1 | Walk |
| 4480 | 2017-08-22 | 2017-08-22 16:01:32 | 1 | Walk |
| 4481 | 2017-08-22 | 2017-08-22 16:01:48 | 1 | Walk |
| 4482 | 2017-08-24 | 2017-08-24 13:17:45 | 1 | Metro |
| 4483 | 2017-09-03 | 2017-09-03 09:27:19 | 5 | Walk |
| 4484 | 2017-09-03 | 2017-09-03 09:27:30 | 5 | Walk |
| 4485 | 2017-08-29 | 2017-08-29 12:33:37 | 1 | Train |
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;