View
museum_visit
One row per admitted ticket: the first entry of its day, with the transport answer.
Rows 7,076–7,100 of 9,383
| ticket_idINTEGER | visit_dateany | first_entry_atTEXT | entrance_idINTEGER | transport_modeTEXT |
|---|---|---|---|---|
| 7437 | 2019-02-19 | 2019-02-19 09:40:01 | 1 | Bus |
| 7438 | 2019-02-19 | 2019-02-19 09:37:41 | 1 | Bus |
| 7439 | 2019-02-19 | 2019-02-19 09:42:45 | 1 | Bus |
| 7440 | 2019-02-19 | 2019-02-19 09:42:04 | 1 | Bus |
| 7441 | 2019-02-19 | 2019-02-19 09:42:13 | 1 | Bus |
| 7442 | 2019-02-19 | 2019-02-19 09:38:50 | 1 | Bus |
| 7443 | 2019-02-19 | 2019-02-19 09:47:01 | 1 | Bus |
| 7444 | 2019-01-14 | 2019-01-14 13:46:27 | 3 | Walk |
| 7445 | 2019-01-14 | 2019-01-14 13:46:13 | 3 | Walk |
| 7446 | 2019-01-28 | 2019-01-28 10:50:05 | 4 | Metro |
| 7447 | 2019-01-28 | 2019-01-28 10:49:21 | 4 | Metro |
| 7448 | 2019-02-14 | 2019-02-14 10:28:49 | 1 | Private Vehicle |
| 7449 | 2019-01-30 | 2019-01-30 09:09:19 | 2 | Metro |
| 7450 | 2019-01-30 | 2019-01-30 09:09:10 | 2 | Metro |
| 7451 | 2019-02-12 | 2019-02-12 14:47:41 | 4 | Walk |
| 7452 | 2019-01-24 | 2019-01-24 14:42:53 | 2 | Walk |
| 7453 | 2019-01-19 | 2019-01-19 09:11:32 | 2 | Private Vehicle |
| 7454 | 2019-01-19 | 2019-01-19 09:11:06 | 2 | Private Vehicle |
| 7455 | 2019-01-19 | 2019-01-19 09:11:48 | 2 | Private Vehicle |
| 7456 | 2019-01-19 | 2019-01-19 09:11:10 | 2 | Private Vehicle |
| 7457 | 2019-01-19 | 2019-01-19 10:46:59 | 2 | Metro |
| 7458 | 2019-01-19 | 2019-01-19 12:09:13 | 1 | Walk |
| 7459 | 2019-01-19 | 2019-01-19 12:09:00 | 1 | Walk |
| 7464 | 2019-02-19 | 2019-02-19 10:12:31 | 2 | Walk |
| 7465 | 2019-02-19 | 2019-02-19 10:12:28 | 2 | 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;